-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert-examples-repo-to-defs cloud nux quickstart_snowflake (#11137)
* convert-examples-repo-to-defs cloud nux quickstart_aws * black, isort * convert-examples-repo-to-defs cloud nux quickstart_gcp * isort * convert-examples-repo-to-defs cloud nux quickstart_snowflake * snowflake_pandas_io_manager
- Loading branch information
Showing
5 changed files
with
42 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.dagster] | ||
module_name = "quickstart_snowflake" |
35 changes: 34 additions & 1 deletion
35
examples/quickstart_snowflake/quickstart_snowflake/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
from .repository import quickstart_snowflake | ||
from dagster_snowflake_pandas import snowflake_pandas_io_manager | ||
|
||
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), | ||
resources={ | ||
"io_manager": snowflake_pandas_io_manager.configured( | ||
# Read about using environment variables and secrets in Dagster: | ||
# https://docs.dagster.io/guides/dagster/using-environment-variables-and-secrets | ||
{ | ||
"account": {"env": "SNOWFLAKE_ACCOUNT"}, | ||
"user": {"env": "SNOWFLAKE_USER"}, | ||
"password": {"env": "SNOWFLAKE_PASSWORD"}, | ||
"warehouse": {"env": "SNOWFLAKE_WAREHOUSE"}, | ||
"database": {"env": "SNOWFLAKE_DATABASE"}, | ||
"schema": {"env": "SNOWFLAKE_SCHEMA"}, | ||
} | ||
), | ||
}, | ||
schedules=[daily_refresh_schedule], | ||
) |
40 changes: 0 additions & 40 deletions
40
examples/quickstart_snowflake/quickstart_snowflake/repository.py
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
examples/quickstart_snowflake/quickstart_snowflake_tests/test_defs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from quickstart_snowflake import defs | ||
|
||
|
||
def test_def_can_load(): | ||
assert defs.get_job_def("all_assets_job") |
This file was deleted.
Oops, something went wrong.