Skip to content

Commit

Permalink
fix: drop dups if cols exist
Browse files Browse the repository at this point in the history
  • Loading branch information
cullenwatson committed Sep 19, 2023
1 parent e191700 commit 42e8ac4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion homeharvest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,8 @@ def scrape_property(
return pd.DataFrame()

final_df = pd.concat(results, ignore_index=True)
final_df = final_df.drop_duplicates(subset=["street_address", "city", "unit"], keep="first")
dupe_check_columns = ["street_address", "city", "unit"]
if all(col in final_df.columns for col in dupe_check_columns):
final_df = final_df.drop_duplicates(subset=dupe_check_columns, keep="first")

return final_df

0 comments on commit 42e8ac4

Please sign in to comment.