get rid of local

This commit is contained in:
Jun-te Kim 2026-02-11 17:50:47 +00:00
parent e7691570fd
commit b1164ffd90
2 changed files with 9 additions and 5 deletions

View file

@ -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})}

View file

@ -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}",