Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Nov 13, 2024
1 parent 4e21e8b commit 5533812
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _get_filetype(self, file: IOBase, remote_file: RemoteFile) -> Optional[FileT
# if possible, try to leverage the file name to detect the file type
# if the file name is not available, use the file content
file_type = detect_filetype(
filename=remote_file.uri,
file_path=remote_file.uri,
)
if file_type is not None and not file_type == FileType.UNK:
return file_type
Expand All @@ -383,7 +383,9 @@ def _render_markdown(self, elements: List[Any]) -> str:

def _convert_to_markdown(self, el: Dict[str, Any]) -> str:
if dpath.get(el, "type") == "Title":
heading_str = "#" * (dpath.get(el, "metadata/category_depth", default=1) or 1)
heading_str = "#" * int(
dpath.get(el, "metadata/category_depth", default=1) or 1,
)
return f"{heading_str} {dpath.get(el, 'text')}"
elif dpath.get(el, "type") == "ListItem":
return f"- {dpath.get(el, 'text')}"
Expand Down

0 comments on commit 5533812

Please sign in to comment.