community[patch]: type ignore fixes (#18395)

Related to #17048
pull/18463/head
Daniel Chico 4 months ago committed by GitHub
parent 69be82c86d
commit 7d962278f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -50,7 +50,7 @@ class _KdtSuggestContext(BaseModel):
lines.append("(")
if not self.columns or len(self.columns) == 0:
ValueError(detail="columns list can't be null.") # type: ignore
ValueError("columns list can't be null.")
columns = []
for column in self.columns:

@ -39,7 +39,7 @@ class AzureBlobStorageContainerLoader(BaseLoader):
loader = AzureBlobStorageFileLoader(
self.conn_str,
self.container,
blob.name, # type: ignore
blob.name,
)
docs.extend(loader.load())
return docs

@ -176,16 +176,16 @@ class BlackboardLoader(WebBaseLoader):
from bs4 import BeautifulSoup, Tag
# Get content list
content_list: BeautifulSoup
content_list = soup.find("ul", {"class": "contentList"})
if content_list is None:
raise ValueError("No content list found.")
content_list: BeautifulSoup # type: ignore
# Get all attachments
attachments = []
attachment: Tag
for attachment in content_list.find_all("ul", {"class": "attachments"}):
attachment: Tag # type: ignore
link: Tag
for link in attachment.find_all("a"):
link: Tag # type: ignore
href = link.get("href")
# Only add if href is not None and does not start with #
if href is not None and not href.startswith("#"):

@ -469,7 +469,7 @@ class ConfluenceLoader(BaseLoader):
)
if include_comments or not keep_markdown_format:
try:
from bs4 import BeautifulSoup # type: ignore
from bs4 import BeautifulSoup
except ImportError:
raise ImportError(
"`beautifulsoup4` package not found, please run "

Loading…
Cancel
Save