Skip to content

Commit

Permalink
Move Definitions to definitions.py (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong authored Jul 22, 2024
1 parent 66eaebb commit db898fc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.dagster]
module_name = "quickstart_etl"
module_name = "quickstart_etl.definitions"
code_location_name = "quickstart_etl"
16 changes: 0 additions & 16 deletions quickstart_etl/__init__.py
Original file line number Diff line number Diff line change
@@ -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]
)
16 changes: 16 additions & 0 deletions quickstart_etl/definitions.py
Original file line number Diff line number Diff line change
@@ -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]
)
2 changes: 1 addition & 1 deletion quickstart_etl_tests/test_defs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from quickstart_etl import defs
from quickstart_etl.definitions import defs


def test_def_can_load():
Expand Down
2 changes: 1 addition & 1 deletion workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
load_from:
- python_package: quickstart_etl
- python_package: quickstart_etl.definitions

0 comments on commit db898fc

Please sign in to comment.