From d6ae0e0fe968308eddaff75b1ea46d7be17d79ce Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Mon, 22 Jul 2024 16:26:06 -0400 Subject: [PATCH] Move Definitions to definitions.py --- dagster_cloud.yaml | 2 +- pyproject.toml | 3 ++- quickstart_etl/__init__.py | 16 ---------------- quickstart_etl/definitions.py | 16 ++++++++++++++++ 4 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 quickstart_etl/definitions.py diff --git a/dagster_cloud.yaml b/dagster_cloud.yaml index 4807cef..c6f3af3 100644 --- a/dagster_cloud.yaml +++ b/dagster_cloud.yaml @@ -1,7 +1,7 @@ locations: - location_name: quickstart_etl code_source: - package_name: quickstart_etl + package_name: quickstart_etl.definitions build: directory: ./ registry: .dkr.ecr.us-west-2.amazonaws.com/ diff --git a/pyproject.toml b/pyproject.toml index db34245..ef6a022 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,4 +3,5 @@ requires = ["setuptools"] build-backend = "setuptools.build_meta" [tool.dagster] -module_name = "quickstart_etl" \ No newline at end of file +module_name = "quickstart_etl.definitions" +code_location_name = "quickstart_etl" \ No newline at end of file diff --git a/quickstart_etl/__init__.py b/quickstart_etl/__init__.py index 3070b3e..e69de29 100644 --- a/quickstart_etl/__init__.py +++ b/quickstart_etl/__init__.py @@ -1,16 +0,0 @@ -from dagster import ( - Definitions, - ScheduleDefinition, - define_asset_job, - load_assets_from_package_module, -) - -from . import assets - -daily_refresh_schedule = ScheduleDefinition( - job=define_asset_job(name="all_assets_job"), cron_schedule="0 0 * * *" -) - -defs = Definitions( - assets=load_assets_from_package_module(assets), schedules=[daily_refresh_schedule] -) diff --git a/quickstart_etl/definitions.py b/quickstart_etl/definitions.py new file mode 100644 index 0000000..3070b3e --- /dev/null +++ b/quickstart_etl/definitions.py @@ -0,0 +1,16 @@ +from dagster import ( + Definitions, + ScheduleDefinition, + define_asset_job, + load_assets_from_package_module, +) + +from . import assets + +daily_refresh_schedule = ScheduleDefinition( + job=define_asset_job(name="all_assets_job"), cron_schedule="0 0 * * *" +) + +defs = Definitions( + assets=load_assets_from_package_module(assets), schedules=[daily_refresh_schedule] +)