airflow.example_dags.example_asset_partition

Attributes

team_a_player_stats

combined_player_stats

regional_sales

region_raw_stats

daily_sales

daily_costs

daily_team_a

monthly_team_a

weekly_model_artifact

Functions

ingest_team_a_stats()

Materialize Team A player statistics for the current hourly partition.

team_b_player_stats()

Produce hourly partitioned stats for Team B.

team_c_player_stats()

Produce hourly partitioned stats for Team C.

combine_player_stats([dag_run])

Merge the aligned hourly partitions into a combined dataset.

compute_player_odds()

Compute player odds from the combined hourly statistics.

check_partition_alignment()

ingest_sales()

Ingest regional sales data partitioned by region and time.

aggregate_sales([dag_run])

Aggregate sales data for the matched region-day partition.

ingest_region()

Materialize player statistics for a single region partition.

regional_stats_breakdown()

Aggregate regional player statistics.

live_region_player_stats(self, outlet_events)

Produce a single region partition whose key is decided at runtime.

summarize_live_region([dag_run])

Summarize stats for the matched runtime partition.

multi_region_player_stats(self, outlet_events)

Produce several region partitions from a single run.

summarise_team_a_day([dag_run])

Produce the full-day rollup once every hour has arrived.

summarise_team_a_month([dag_run])

Produce the full-month rollup once every day has arrived.

train_model()

Materialize the model artifact for the current weekly partition.

run_inference([dag_run])

Run inference for one daily partition derived from the weekly model.

aggregate_all_regions([dag_run])

Produce the cross-region summary once every region partition has arrived.

Module Contents

airflow.example_dags.example_asset_partition.team_a_player_stats[source]
airflow.example_dags.example_asset_partition.combined_player_stats[source]
airflow.example_dags.example_asset_partition.ingest_team_a_stats()[source]

Materialize Team A player statistics for the current hourly partition.

airflow.example_dags.example_asset_partition.team_b_player_stats()[source]

Produce hourly partitioned stats for Team B.

airflow.example_dags.example_asset_partition.team_c_player_stats()[source]

Produce hourly partitioned stats for Team C.

airflow.example_dags.example_asset_partition.combine_player_stats(dag_run=None)[source]

Merge the aligned hourly partitions into a combined dataset.

airflow.example_dags.example_asset_partition.compute_player_odds()[source]

Compute player odds from the combined hourly statistics.

This asset is partition-aware and triggered by the combined stats asset.

airflow.example_dags.example_asset_partition.check_partition_alignment()[source]
airflow.example_dags.example_asset_partition.regional_sales[source]
airflow.example_dags.example_asset_partition.ingest_sales()[source]

Ingest regional sales data partitioned by region and time.

airflow.example_dags.example_asset_partition.aggregate_sales(dag_run=None)[source]

Aggregate sales data for the matched region-day partition.

airflow.example_dags.example_asset_partition.region_raw_stats[source]
airflow.example_dags.example_asset_partition.ingest_region()[source]

Materialize player statistics for a single region partition.

airflow.example_dags.example_asset_partition.regional_stats_breakdown()[source]

Aggregate regional player statistics.

This asset demonstrates AllowedKeyMapper, which validates that upstream partition keys belong to a fixed set of allowed values (us, eu, apac) rather than time-based partitions.

airflow.example_dags.example_asset_partition.live_region_player_stats(self, outlet_events)[source]

Produce a single region partition whose key is decided at runtime.

This asset demonstrates PartitionAtRuntime, which records the partition key on the emitted event with add_partitions while the task runs rather than from a timetable.

airflow.example_dags.example_asset_partition.summarize_live_region(dag_run=None)[source]

Summarize stats for the matched runtime partition.

airflow.example_dags.example_asset_partition.multi_region_player_stats(self, outlet_events)[source]

Produce several region partitions from a single run.

This asset demonstrates runtime fan-out, where each key emits its own asset event and duplicate keys collapse to a single event.

airflow.example_dags.example_asset_partition.daily_sales[source]
airflow.example_dags.example_asset_partition.daily_costs[source]
airflow.example_dags.example_asset_partition.daily_team_a[source]
airflow.example_dags.example_asset_partition.monthly_team_a[source]
airflow.example_dags.example_asset_partition.summarise_team_a_day(dag_run=None)[source]

Produce the full-day rollup once every hour has arrived.

airflow.example_dags.example_asset_partition.summarise_team_a_month(dag_run=None)[source]

Produce the full-month rollup once every day has arrived.

airflow.example_dags.example_asset_partition.weekly_model_artifact[source]
airflow.example_dags.example_asset_partition.train_model()[source]

Materialize the model artifact for the current weekly partition.

airflow.example_dags.example_asset_partition.run_inference(dag_run=None)[source]

Run inference for one daily partition derived from the weekly model.

airflow.example_dags.example_asset_partition.aggregate_all_regions(dag_run=None)[source]

Produce the cross-region summary once every region partition has arrived.

Was this entry helpful?