mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
get rid of local
This commit is contained in:
parent
e7691570fd
commit
b1164ffd90
2 changed files with 9 additions and 5 deletions
|
|
@ -358,9 +358,9 @@ def get_uprn_with_epc_df(
|
||||||
# Best score
|
# Best score
|
||||||
best_score = scored_df.iloc[0]["lexiscore"]
|
best_score = scored_df.iloc[0]["lexiscore"]
|
||||||
|
|
||||||
# Return None if score is below threshold
|
# # Return None if score is below threshold
|
||||||
if best_score < 0.7:
|
# if best_score < 0.7:
|
||||||
return None
|
# return None
|
||||||
|
|
||||||
# All rank-1 rows (possible draw)
|
# All rank-1 rows (possible draw)
|
||||||
top_rank_df = scored_df[scored_df["lexirank"] == 1]
|
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}")
|
logger.error(f"Failed to update subtask status: {db_error}")
|
||||||
|
|
||||||
# Return error if all records failed
|
# Return error if all records failed
|
||||||
|
logger.info(results_data)
|
||||||
logger.info(results)
|
logger.info(results)
|
||||||
if errors and not results:
|
if errors and not results:
|
||||||
return {"statusCode": 500, "body": json.dumps({"errors": errors})}
|
return {"statusCode": 500, "body": json.dumps({"errors": errors})}
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,8 @@ def handler(event, context, local=False):
|
||||||
csv_data = read_csv_from_s3_dict(bucket, key)
|
csv_data = read_csv_from_s3_dict(bucket, key)
|
||||||
df = pd.DataFrame(csv_data)
|
df = pd.DataFrame(csv_data)
|
||||||
# just do 5 well we are testing, sqs connection
|
# 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")
|
logger.info(f"CSV loaded: {len(df)} rows, {len(df.columns)} columns")
|
||||||
|
|
||||||
# Sanitise postcodes
|
# Sanitise postcodes
|
||||||
|
|
@ -193,7 +194,9 @@ def handler(event, context, local=False):
|
||||||
task_id=str(task_id),
|
task_id=str(task_id),
|
||||||
rows=all_rows,
|
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:
|
except Exception as e:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"Failed to send all rows to address2UPRN queue: {e}",
|
f"Failed to send all rows to address2UPRN queue: {e}",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue