-
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.
[dagster-airlift] peer/observe/migrate for dbt example
- Loading branch information
Showing
11 changed files
with
112 additions
and
32 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
examples/experimental/dagster-airlift/examples/dbt-example/.vscode/settings.json
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,12 @@ | ||
{ | ||
"python.analysis.userFileIndexingLimit": 5000, | ||
"python.analysis.indexing": true, | ||
"python.analysis.extraPaths": [ | ||
"../../../../../python_modules/dagster", | ||
"../../../../../examples/experimental/dagster-airlift", | ||
"../../../../../examples/experimental/dagster-blueprints", | ||
"../../../../../python_modules/libraries/dagster-dbt" | ||
], | ||
"python.analysis.diagnosticMode": "openFilesOnly", | ||
"python.analysis.useLibraryCodeForTypes": false, | ||
} |
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
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
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
1 change: 0 additions & 1 deletion
1
...es/experimental/dagster-airlift/examples/dbt-example/dbt_example/dagster_defs/__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 +0,0 @@ | ||
from .definitions import defs as defs | ||
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
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
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
30 changes: 30 additions & 0 deletions
30
...les/experimental/dagster-airlift/examples/dbt-example/dbt_example/dagster_defs/observe.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,30 @@ | ||
from dagster_airlift.core import AirflowInstance, BasicAuthBackend, build_defs_from_airflow_instance | ||
from dagster_airlift.core.def_factory import defs_from_factories | ||
from dagster_airlift.dbt import DbtProjectDefs | ||
|
||
from dbt_example.dagster_defs.csv_to_duckdb_defs import CSVToDuckdbDefs | ||
|
||
from .constants import AIRFLOW_BASE_URL, AIRFLOW_INSTANCE_NAME, PASSWORD, USERNAME, dbt_project_path | ||
|
||
airflow_instance = AirflowInstance( | ||
auth_backend=BasicAuthBackend( | ||
webserver_url=AIRFLOW_BASE_URL, username=USERNAME, password=PASSWORD | ||
), | ||
name=AIRFLOW_INSTANCE_NAME, | ||
) | ||
|
||
|
||
defs = build_defs_from_airflow_instance( | ||
airflow_instance=airflow_instance, | ||
orchestrated_defs=defs_from_factories( | ||
CSVToDuckdbDefs( | ||
name="load_lakehouse__load_iris", | ||
table_name="iris_lakehouse_table", | ||
duckdb_schema="iris_dataset", | ||
), | ||
DbtProjectDefs( | ||
name="dbt_dag__build_dbt_models", | ||
dbt_manifest=dbt_project_path() / "target" / "manifest.json", | ||
), | ||
), | ||
) |
13 changes: 13 additions & 0 deletions
13
examples/experimental/dagster-airlift/examples/dbt-example/dbt_example/dagster_defs/peer.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,13 @@ | ||
from dagster_airlift.core import AirflowInstance, BasicAuthBackend, build_defs_from_airflow_instance | ||
|
||
from .constants import AIRFLOW_BASE_URL, AIRFLOW_INSTANCE_NAME, PASSWORD, USERNAME | ||
|
||
airflow_instance = AirflowInstance( | ||
auth_backend=BasicAuthBackend( | ||
webserver_url=AIRFLOW_BASE_URL, username=USERNAME, password=PASSWORD | ||
), | ||
name=AIRFLOW_INSTANCE_NAME, | ||
) | ||
|
||
|
||
defs = build_defs_from_airflow_instance(airflow_instance=airflow_instance) |
10 changes: 8 additions & 2 deletions
10
.../experimental/dagster-airlift/examples/dbt-example/dbt_example_tests/test_load_dagster.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,4 +1,10 @@ | ||
def test_defs_loads(airflow_instance): | ||
from dbt_example.dagster_defs import defs | ||
def test_defs_loads(airflow_instance) -> None: | ||
from dbt_example.dagster_defs.peer import defs | ||
|
||
assert defs | ||
from dbt_example.dagster_defs.observe import defs | ||
|
||
assert defs | ||
from dbt_example.dagster_defs.migrate import defs | ||
|
||
assert defs |