diff --git a/backend/address2UPRN/main.py b/backend/address2UPRN/main.py index 7e001b8d..812b9206 100644 --- a/backend/address2UPRN/main.py +++ b/backend/address2UPRN/main.py @@ -358,9 +358,9 @@ def get_uprn_with_epc_df( # Best score best_score = scored_df.iloc[0]["lexiscore"] - # Return None if score is below threshold - if best_score < 0.7: - return None + # # Return None if score is below threshold + # if best_score < 0.7: + # return None # All rank-1 rows (possible draw) top_rank_df = scored_df[scored_df["lexirank"] == 1] @@ -807,6 +807,7 @@ def handler(event, context, local=False): logger.error(f"Failed to update subtask status: {db_error}") # Return error if all records failed + logger.info(results_data) logger.info(results) if errors and not results: return {"statusCode": 500, "body": json.dumps({"errors": errors})} diff --git a/backend/postcode_splitter/main.py b/backend/postcode_splitter/main.py index eb7cf044..943435b9 100644 --- a/backend/postcode_splitter/main.py +++ b/backend/postcode_splitter/main.py @@ -162,7 +162,8 @@ def handler(event, context, local=False): csv_data = read_csv_from_s3_dict(bucket, key) df = pd.DataFrame(csv_data) # just do 5 well we are testing, sqs connection - df = df.head(5) + if local: + df = df.head(5) logger.info(f"CSV loaded: {len(df)} rows, {len(df.columns)} columns") # Sanitise postcodes @@ -193,7 +194,9 @@ def handler(event, context, local=False): task_id=str(task_id), rows=all_rows, ) - logger.info(f"Sent all {len(all_rows)} rows in single batch to address2UPRN queue") + logger.info( + f"Sent all {len(all_rows)} rows in single batch to address2UPRN queue" + ) except Exception as e: logger.error( f"Failed to send all rows to address2UPRN queue: {e}",