Skip to content

Commit

Permalink
more edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsonlive committed Jan 9, 2024
1 parent ada50e6 commit a22e4cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/bam_core/utils/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def format_address(
input_granularity = norm_address.get("verdict", {}).get("inputGranularity", "")
if granularity == "SUB_PREMISE":
response["cleaned_address_accuracy"] = "Apartment"
elif granularity == "PREMISE" or input_granularity == "PREMISE":
# never confirm apartment-level granularity based on input-level granularity
elif granularity == "PREMISE" or input_granularity.endswith("PREMISE"):
response["cleaned_address_accuracy"] = "Building"

usps_data = norm_address.get("uspsData", {}).get("standardizedAddress", {})
Expand Down

0 comments on commit a22e4cc

Please sign in to comment.