Skip to content

Commit

Permalink
- data cleaning & CONDOP bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacharyHampton committed May 13, 2024
1 parent b23b55c commit 803fd61
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion homeharvest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def scrape_property(
if not properties_dfs:
return pd.DataFrame()

properties_dfs = [df for df in properties_dfs if not df.empty]

with warnings.catch_warnings():
warnings.simplefilter("ignore", category=FutureWarning)

return pd.concat(properties_dfs, ignore_index=True, axis=0)[ordered_properties].replace({"None": "", None: ""})
return pd.concat(properties_dfs, ignore_index=True, axis=0)[ordered_properties].replace({"None": pd.NA, None: pd.NA, "": pd.NA})
1 change: 1 addition & 0 deletions homeharvest/core/scrapers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class PropertyType(Enum):
CONDO_TOWNHOME = "CONDO_TOWNHOME"
CONDO_TOWNHOME_ROWHOME_COOP = "CONDO_TOWNHOME_ROWHOME_COOP"
CONDO = "CONDO"
CONDOP = "CONDOP"
CONDOS = "CONDOS"
COOP = "COOP"
DUPLEX_TRIPLEX = "DUPLEX_TRIPLEX"
Expand Down
2 changes: 1 addition & 1 deletion homeharvest/core/scrapers/realtor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def _parse_description(result: dict) -> Description:
return Description(
primary_photo=primary_photo,
alt_photos=RealtorScraper.process_alt_photos(result.get("photos")),
style=PropertyType(style) if style else None,
style=PropertyType.__getitem__(style) if style and style in PropertyType.__members__ else None,
beds=description_data.get("beds"),
baths_full=description_data.get("baths_full"),
baths_half=description_data.get("baths_half"),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "homeharvest"
version = "0.3.23"
version = "0.3.24"
description = "Real estate scraping library"
authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"]
homepage = "https://github.com/Bunsly/HomeHarvest"
Expand Down

0 comments on commit 803fd61

Please sign in to comment.