Skip to content

Commit

Permalink
convert-examples-repo-to-defs cloud nux quickstart_snowflake
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan committed Dec 15, 2022
1 parent 6a2065f commit 62d984b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
3 changes: 3 additions & 0 deletions examples/quickstart_snowflake/pyproject.toml
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"
36 changes: 35 additions & 1 deletion examples/quickstart_snowflake/quickstart_snowflake/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
from .repository import quickstart_snowflake
from dagster_snowflake import build_snowflake_io_manager
from dagster_snowflake_pandas import SnowflakePandasTypeHandler

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": build_snowflake_io_manager([SnowflakePandasTypeHandler()]).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 examples/quickstart_snowflake/quickstart_snowflake/repository.py

This file was deleted.

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")
2 changes: 0 additions & 2 deletions examples/quickstart_snowflake/workspace.yaml

This file was deleted.

0 comments on commit 62d984b

Please sign in to comment.