-
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.
- Loading branch information
Showing
7 changed files
with
181 additions
and
3 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
25 changes: 25 additions & 0 deletions
25
examples/experimental/dagster-dlift/dagster_dlift/gql_queries.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
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: 2 additions & 0 deletions
2
examples/experimental/dagster-dlift/kitchen-sink/dlift_kitchen_sink/constants.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,2 @@ | ||
TEST_ENV_NAME = "test" | ||
EXPECTED_TAG = "test" |
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
52 changes: 52 additions & 0 deletions
52
...experimental/dagster-dlift/kitchen-sink/dlift_kitchen_sink_tests/test_instance_methods.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,52 @@ | ||
from dlift_kitchen_sink.constants import EXPECTED_TAG, TEST_ENV_NAME | ||
from dlift_kitchen_sink.instance import get_instance | ||
|
||
|
||
def test_get_models() -> None: | ||
env_id = get_instance().get_environment_id_by_name(TEST_ENV_NAME) | ||
# Filter to only the models that we use for testing. | ||
models_response = [ | ||
model for model in get_instance().get_dbt_models(env_id) if EXPECTED_TAG in model["tags"] | ||
] | ||
|
||
assert len(models_response) == 3 | ||
customers = next( | ||
iter( | ||
[ | ||
model | ||
for model in models_response | ||
if model["uniqueId"] == "model.test_environment.customers" | ||
] | ||
) | ||
) | ||
assert len(customers["parents"]) == 2 | ||
assert {parent["uniqueId"] for parent in customers["parents"]} == { | ||
"model.test_environment.stg_customers", | ||
"model.test_environment.stg_orders", | ||
} | ||
stg_customers = next( | ||
iter( | ||
[ | ||
model | ||
for model in models_response | ||
if model["uniqueId"] == "model.test_environment.stg_customers" | ||
] | ||
) | ||
) | ||
assert len(stg_customers["parents"]) == 1 | ||
assert {parent["uniqueId"] for parent in stg_customers["parents"]} == { | ||
"source.test_environment.jaffle_shop.customers_raw" | ||
} | ||
stg_orders = next( | ||
iter( | ||
[ | ||
model | ||
for model in models_response | ||
if model["uniqueId"] == "model.test_environment.stg_orders" | ||
] | ||
) | ||
) | ||
assert len(stg_orders["parents"]) == 1 | ||
assert {parent["uniqueId"] for parent in stg_orders["parents"]} == { | ||
"source.test_environment.jaffle_shop.orders_raw" | ||
} |