Skip to content

Commit

Permalink
fix: configure ban address jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
loicguillois committed Jan 30, 2025
1 parent 8547d30 commit 27fa992
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
35 changes: 30 additions & 5 deletions analytics/dagster/src/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
from .project import dbt_project
from .assets import production_dbt

from .assets import populate_owners_ban_addresses
from .assets import populate_housings_ban_addresses
from .assets.populate_owners_ban_addresses import owners_without_address, create_csv_chunks_from_owners, send_csv_chunks_to_api, parse_api_response_and_insert_owners_addresses
from .assets.populate_housings_ban_addresses import housings_without_address, create_csv_from_housings, send_csv_to_api, parse_api_response_and_insert_housing_addresses
from .resources.ban_config import ban_config_resource
from .resources.database_resources import psycopg2_connection_resource
from .resources.database_resources import sqlalchemy_engine_resource

from .assets import clever

Expand Down Expand Up @@ -88,14 +90,34 @@
job=yearly_update_ff_dwh_job, cron_schedule="@yearly"
)

owners_asset_job = define_asset_job(
name="populate_owners_addresses",
selection=AssetSelection.assets(
"owners_without_address",
"create_csv_chunks_from_owners",
"send_csv_chunks_to_api",
"parse_api_response_and_insert_owners_addresses",
),
)

housings_asset_job = define_asset_job(
name="populate_housings_addresses",
selection=AssetSelection.assets(
"housings_without_address",
"create_csv_from_housings",
"send_csv_to_api",
"parse_api_response_and_insert_housing_addresses",
),
)

# Load definitions with assets, resources, and schedule
defs = Definitions(
assets=[
# dagster_production_assets,
# dagster_notion_assets,
# dagster_notion_assets,
populate_owners_ban_addresses,
populate_housings_ban_addresses,
owners_without_address, create_csv_chunks_from_owners, send_csv_chunks_to_api, parse_api_response_and_insert_owners_addresses,
housings_without_address, create_csv_from_housings, send_csv_to_api, parse_api_response_and_insert_housing_addresses,
*dwh_assets,
*dbt_analytics_assets,
*clever_assets_assets
Expand All @@ -112,7 +134,10 @@
"duckdb_local_metabase": DuckDBResource(
database="db/metabase.duckdb",
),
"ban_config": ban_config_resource
"ban_config": ban_config_resource,
"psycopg2_connection": psycopg2_connection_resource,
"sqlalchemy_engine": sqlalchemy_engine_resource,
},
schedules=[daily_refresh_schedule, yearly_ff_refresh_schedule],
jobs=[owners_asset_job, housings_asset_job],
)
6 changes: 0 additions & 6 deletions analytics/dagster/workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
load_from:
- python_module: src
- python_file:
relative_path: jobs/ban_address_jobs.py

resources:
ban_config:
config: {}

0 comments on commit 27fa992

Please sign in to comment.