Merge pull request #826 from Hestia-Homes/feautre/calico_example

ignore if score is 0
This commit is contained in:
Daniel Roth 2026-03-10 15:25:46 +00:00 committed by GitHub
commit cab0dec440
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,13 +60,6 @@ def check_if_post_code_exists_in_db_cache(postcode):
return os_places_results_to_dataframe(response["data"])
def get_ordance_survey_record(row, cache=None):
if cache is None:
cache = check_if_post_code_exists_in_db_cache(postcode)
# process cache with row
def save_results_to_s3(
results_df: pd.DataFrame,
task_id: str,
@ -211,6 +204,9 @@ def handler(body: dict[str, Any], context: Any, local: bool = False) -> None:
best_idx = scores.idxmax()
best_score = scores[best_idx]
if best_score <= 0:
continue
df.at[idx, "ordnance_survey_address"] = postcode_cache.at[
best_idx, "ADDRESS"
]