Skip to content

Commit

Permalink
updates 2024-11-15 - flood data errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CHRISCARLON committed Nov 15, 2024
1 parent c66931b commit 72e69d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def ea_flood_public_forecast_bronze(context: AssetExecutionContext):
validation_errors = e.errors()

df = pl.DataFrame(data)

context.log.info(f"Processed {len(df)} records with {len(validation_errors)} validation errors")
context.log.info(f"{df.head(5)}")

parquet_buffer = io.BytesIO()
df.write_parquet(parquet_buffer)
Expand All @@ -54,8 +56,12 @@ def ea_flood_public_forecast_silver(context: AssetExecutionContext, ea_flood_pub
"""
EA Public Forecast flooding data silver bucket
"""

data = ea_flood_public_forecast_bronze.to_dict()
print(data)

# Load data into model
flood_risk_data = FloodRiskData.model_validate(ea_flood_public_forecast_bronze.to_dict())
flood_risk_data = FloodRiskData.model_validate(data)

# Create flattened dictionary structure
output = {
Expand Down
Empty file.

This file was deleted.

0 comments on commit 72e69d2

Please sign in to comment.