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

Related to #17048
This commit is contained in:
Daniel Chico
2024-03-01 14:21:02 -05:00
committed by GitHub
parent 69be82c86d
commit 7d962278f6
4 changed files with 6 additions and 6 deletions

View File

@@ -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("#"):