Handle empty dataframes
This commit is contained in:
parent
82178b4c6e
commit
50543bd22a
|
@ -19,7 +19,7 @@ def dataframe_to_urlmap(df: pd.DataFrame) -> dict[httpx.URL, set[httpx.URL]]:
|
|||
:return: A dictionary where the key is a source URL, and the value is a set of target URLs.
|
||||
"""
|
||||
urlmap = {}
|
||||
for source, target in zip(df["source"], df["target"], strict=True):
|
||||
for source, target in zip(df.get("source", pd.Series()), df.get("target", pd.Series()), strict=True):
|
||||
source_url = httpx.URL(source)
|
||||
target_url = httpx.URL(target)
|
||||
if source_url not in urlmap:
|
||||
|
|
Loading…
Reference in a new issue