mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
address 2uprn and postcode splitter works locally
This commit is contained in:
parent
8e574c2401
commit
c1f784b87f
2 changed files with 5 additions and 7 deletions
|
|
@ -504,6 +504,8 @@ def save_results_to_s3(
|
||||||
"""
|
"""
|
||||||
if bucket_name is None:
|
if bucket_name is None:
|
||||||
bucket_name = os.getenv("S3_BUCKET_NAME")
|
bucket_name = os.getenv("S3_BUCKET_NAME")
|
||||||
|
if bucket_name is None:
|
||||||
|
bucket_name = "retrofit-data-dev"
|
||||||
|
|
||||||
if not bucket_name:
|
if not bucket_name:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
@ -544,8 +546,8 @@ def handler(event, context, local=False):
|
||||||
"body": json.dumps(
|
"body": json.dumps(
|
||||||
{
|
{
|
||||||
"task_id": "e31f2f21-175b-4a91-a3ec-a6baa325e917",
|
"task_id": "e31f2f21-175b-4a91-a3ec-a6baa325e917",
|
||||||
"sub_task_id": "1c09df07-fd29-4de7-b146-fafb591856a9",
|
"sub_task_id": "6a427b6e-1ece-4983-b1e5-9bffccc53d1d",
|
||||||
"s3_uri": "s3://retrofit-data-dev/ara_postcode_splitter_batches/e31f2f21-175b-4a91-a3ec-a6baa325e917/8673913b-1a88-42d7-8578-0449123d94b0/2026-02-13T15:54:58.568594_67557923.csv",
|
"s3_uri": "s3://retrofit-data-dev/ara_postcode_splitter_batches/e31f2f21-175b-4a91-a3ec-a6baa325e917/8673913b-1a88-42d7-8578-0449123d94b0/2026-02-16T12:00:20.257856_7b520c0e.csv",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -204,10 +204,6 @@ 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)
|
||||||
|
|
||||||
# TODO: Change the input to the file you want
|
|
||||||
# df = df.head(1983)
|
|
||||||
df = df.head(502)
|
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -288,7 +284,7 @@ def handler(event, context, local=False):
|
||||||
subtask_interface.update_subtask_status(
|
subtask_interface.update_subtask_status(
|
||||||
subtask_id,
|
subtask_id,
|
||||||
"completed",
|
"completed",
|
||||||
outputs={"rows_processed": "todo -> show sensible output"},
|
outputs={"rows_processed": "completed"},
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue