-
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
9 changed files
with
114 additions
and
29 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
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
43 changes: 43 additions & 0 deletions
43
...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,43 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
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", | ||
csv_path=Path("iris.csv"), | ||
duckdb_path=Path(os.environ["AIRFLOW_HOME"]) / "jaffle_shop.duckdb", | ||
column_names=[ | ||
"sepal_length_cm", | ||
"sepal_width_cm", | ||
"petal_length_cm", | ||
"petal_width_cm", | ||
"species", | ||
], | ||
duckdb_schema="iris_dataset", | ||
duckdb_database_name="jaffle_shop", | ||
), | ||
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) |