From 16c4a218797abe80cb2392c15430004b1b56d7cc Mon Sep 17 00:00:00 2001 From: devsjc <47188100+devsjc@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:23:22 +0100 Subject: [PATCH] fix(api): Use newer dagster API naming --- cloud_archives/pv/passiv/passiv_monthly.py | 4 ++-- cloud_archives/pv/passiv/passiv_year.py | 4 ++-- local_archives/nwp/_generic_definitions_factory.py | 4 ++-- local_archives/nwp/gfs/gfs.py | 2 +- tests/cloud_archives/pv/test_passiv.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cloud_archives/pv/passiv/passiv_monthly.py b/cloud_archives/pv/passiv/passiv_monthly.py index 17ed598..6645b72 100644 --- a/cloud_archives/pv/passiv/passiv_monthly.py +++ b/cloud_archives/pv/passiv/passiv_monthly.py @@ -83,7 +83,7 @@ def get_monthly_passiv_data(start_date: datetime, upload_to_hf: bool = True, ove @dg.asset( key=["pv", "passiv", "monthly_30min"], - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), partitions_def=dg.TimeWindowPartitionsDefinition( fmt="%Y-%m", start="2010-01", @@ -104,7 +104,7 @@ def pv_passiv_monthly_30min(context: dg.AssetExecutionContext): @dg.asset( key=["pv", "passiv", "monthly_5min"], - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), partitions_def=dg.TimeWindowPartitionsDefinition( fmt="%Y-%m", start="2018-01", diff --git a/cloud_archives/pv/passiv/passiv_year.py b/cloud_archives/pv/passiv/passiv_year.py index 1210018..3b65252 100644 --- a/cloud_archives/pv/passiv/passiv_year.py +++ b/cloud_archives/pv/passiv/passiv_year.py @@ -67,7 +67,7 @@ def get_yearly_passiv_data(start_date: datetime, upload_to_hf: bool = True, over @dg.asset( key=["pv", "passiv", "yearly_5min"], - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), partitions_def=dg.TimeWindowPartitionsDefinition( fmt="%Y", start="2018", @@ -86,7 +86,7 @@ def pv_passiv_yearly_5min(context: dg.AssetExecutionContext): @dg.asset( key=["pv", "passiv", "yearly_30min"], - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), partitions_def=dg.TimeWindowPartitionsDefinition( fmt="%Y", start="2010", diff --git a/local_archives/nwp/_generic_definitions_factory.py b/local_archives/nwp/_generic_definitions_factory.py index 0d87a43..b3a2a5e 100644 --- a/local_archives/nwp/_generic_definitions_factory.py +++ b/local_archives/nwp/_generic_definitions_factory.py @@ -60,7 +60,7 @@ def make_definitions( @dg.asset( name="raw_archive", key_prefix=opts.key_prefix(), - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), partitions_def=opts.partitions, check_specs=[ dg.AssetCheckSpec( @@ -168,7 +168,7 @@ def _raw_archive( name="zarr_archive", key_prefix=opts.key_prefix(), partitions_def=opts.partitions, - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), ins={"raw_paths": dg.AssetIn(key=_raw_archive.key)}, io_manager_key="nwp_xr_zarr_io", compute_kind="process", diff --git a/local_archives/nwp/gfs/gfs.py b/local_archives/nwp/gfs/gfs.py index f8b06a2..10f8e3b 100644 --- a/local_archives/nwp/gfs/gfs.py +++ b/local_archives/nwp/gfs/gfs.py @@ -13,7 +13,7 @@ name="zarr_daily_archive", description="Daily archive of GFS global NWP data", key_prefix=["nwp", "gfs", "global"], - auto_materialize_policy=dg.AutomationCondition.eager(), + automation_condition=dg.AutomationCondition.eager(), partitions_def=dg.DailyPartitionsDefinition( start_date="2015-01-15", end_offset=-2, diff --git a/tests/cloud_archives/pv/test_passiv.py b/tests/cloud_archives/pv/test_passiv.py index 8dd78e8..6e9139d 100644 --- a/tests/cloud_archives/pv/test_passiv.py +++ b/tests/cloud_archives/pv/test_passiv.py @@ -5,4 +5,4 @@ def test_get_daily_passiv_data(): start_date = datetime(2022, 1, 1, tzinfo=timezone.utc) - get_monthly_passiv_data(start_date, upload_to_hf=False, overwrite=True) \ No newline at end of file + get_monthly_passiv_data(start_date, upload_to_hf=False, overwrite=True)