diff --git a/apps/other/src/assets.py b/apps/other/src/assets.py index 51ec5b5..749f21e 100644 --- a/apps/other/src/assets.py +++ b/apps/other/src/assets.py @@ -1,4 +1,3 @@ -import os import sys from collections.abc import Iterator from functools import partial @@ -7,6 +6,7 @@ from logging import getLogger import pandas as pd import pyarrow as pa from config import APP +from partitions import daily_partitions_def import dagster as dg @@ -50,11 +50,6 @@ def iris_cleaned(table: pa.Table) -> pa.Table: return pa.Table.from_pandas(result_df) -daily_partitions_def = dg.DailyPartitionsDefinition( - start_date="2024-09-01", end_offset=1, timezone=os.environ.get("TZ", "UTC") -) - - @asset(partitions_def=daily_partitions_def) def one() -> Iterator[dg.Output[int]]: # Attempt to materialize multiple times diff --git a/apps/other/src/partitions.py b/apps/other/src/partitions.py new file mode 100644 index 0000000..e78c4ff --- /dev/null +++ b/apps/other/src/partitions.py @@ -0,0 +1,7 @@ +import os + +import dagster as dg + +daily_partitions_def = dg.DailyPartitionsDefinition( + start_date="2024-09-01", end_offset=1, timezone=os.environ.get("TZ", "UTC") +)