diff --git a/backend/ordnanceSurvey/main.py b/backend/ordnanceSurvey/main.py index 6a639b54..6e82b468 100644 --- a/backend/ordnanceSurvey/main.py +++ b/backend/ordnanceSurvey/main.py @@ -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" ]