-
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] change dbt example to include migration fxnality
- Loading branch information
Showing
28 changed files
with
56 additions
and
47 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
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
2 changes: 1 addition & 1 deletion
2
...ample/dagster_defs/migration/dbt_dag.yaml → ...airflow_dags/migration_state/dbt_dag.yaml
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,3 @@ | ||
tasks: | ||
build_dbt_models: | ||
migrated: True | ||
migrated: True |
2 changes: 1 addition & 1 deletion
2
...agster_defs/migration/load_lakehouse.yaml → ..._dags/migration_state/load_lakehouse.yaml
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,3 @@ | ||
tasks: | ||
load_iris: | ||
migrated: False | ||
migrated: True |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
examples/experimental/dagster-airlift/examples/dbt-example/dbt_example/shared/load_iris.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,29 @@ | ||
import os | ||
|
||
import duckdb | ||
import pandas as pd | ||
|
||
|
||
def load_csv_to_duckdb() -> None: | ||
# Absolute path to the iris dataset is path to current file's directory | ||
csv_path = os.path.join(os.path.dirname(__file__), "iris.csv") | ||
# Duckdb database stored in airflow home | ||
duckdb_path = os.path.join(os.environ["AIRFLOW_HOME"], "jaffle_shop.duckdb") | ||
iris_df = pd.read_csv( # noqa: F841 # used by duckdb | ||
csv_path, | ||
names=[ | ||
"sepal_length_cm", | ||
"sepal_width_cm", | ||
"petal_length_cm", | ||
"petal_width_cm", | ||
"species", | ||
], | ||
) | ||
|
||
# Connect to DuckDB and create a new table | ||
con = duckdb.connect(duckdb_path) | ||
con.execute("CREATE SCHEMA IF NOT EXISTS iris_dataset").fetchall() | ||
con.execute( | ||
"CREATE TABLE IF NOT EXISTS jaffle_shop.iris_dataset.iris_lakehouse_table AS SELECT * FROM iris_df" | ||
).fetchall() | ||
con.close() |
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