-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(dbt): assert correct owners when using dbt config inheritance (#…
…20998) ## Summary & Motivation Just add a test to make sure this is working. ## How I Tested These Changes pytest
- Loading branch information
1 parent
3e860bf
commit 9ad6b22
Showing
4 changed files
with
19 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -629,13 +629,13 @@ def my_dbt_assets(): ... | |
# If a model has a Dagster group name specified under `meta`, use that. | ||
AssetKey(["customized", "staging", "customers"]): "customized_dagster_group", | ||
# If a model has a dbt group name specified under `group`, use that. | ||
AssetKey(["customized", "staging", "orders"]): "customized_dbt_group", | ||
AssetKey(["customized", "staging", "orders"]): "customized_dbt_model_group", | ||
# If a model has both a Dagster group and dbt group, use the Dagster group. | ||
AssetKey(["customized", "staging", "payments"]): "customized_dagster_group", | ||
AssetKey(["orders"]): "default", | ||
AssetKey(["raw_customers"]): "default", | ||
AssetKey(["raw_orders"]): "default", | ||
AssetKey(["raw_payments"]): "default", | ||
AssetKey(["raw_customers"]): "customized_dbt_seed_group", | ||
AssetKey(["raw_orders"]): "customized_dbt_seed_group", | ||
AssetKey(["raw_payments"]): "customized_dbt_seed_group", | ||
} | ||
|
||
|
||
|
@@ -649,7 +649,8 @@ def my_dbt_assets(): ... | |
|
||
|
||
def test_dbt_meta_owners(test_meta_config_manifest: Dict[str, Any]) -> None: | ||
expected_dbt_owners = [UserAssetOwner("[email protected]")] | ||
expected_dbt_model_owners = [UserAssetOwner("[email protected]")] | ||
expected_dbt_seed_owners = [UserAssetOwner("[email protected]")] | ||
expected_dagster_owners = [UserAssetOwner("[email protected]")] | ||
|
||
@dbt_assets(manifest=test_meta_config_manifest) | ||
|
@@ -660,13 +661,13 @@ def my_dbt_assets(): ... | |
# If a model has Dagster owners specified under `meta`, use that. | ||
AssetKey(["customized", "staging", "customers"]): [], | ||
# If a model has a dbt owner specified under `group`, use that. | ||
AssetKey(["customized", "staging", "orders"]): expected_dbt_owners, | ||
AssetKey(["customized", "staging", "orders"]): expected_dbt_model_owners, | ||
# If a model has both Dagster owners and a dbt owner, use the Dagster owner. | ||
AssetKey(["customized", "staging", "payments"]): expected_dagster_owners, | ||
AssetKey(["orders"]): [], | ||
AssetKey(["raw_customers"]): [], | ||
AssetKey(["raw_orders"]): [], | ||
AssetKey(["raw_payments"]): [], | ||
AssetKey(["raw_customers"]): expected_dbt_seed_owners, | ||
AssetKey(["raw_orders"]): expected_dbt_seed_owners, | ||
AssetKey(["raw_payments"]): expected_dbt_seed_owners, | ||
} | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2 | ||
|
||
groups: | ||
- name: customized_dbt_group | ||
- name: customized_dbt_model_group | ||
owner: | ||
name: Karl Rossmann | ||
email: [email protected] | ||
|
@@ -21,7 +21,7 @@ models: | |
|
||
- name: stg_orders | ||
config: | ||
group: customized_dbt_group | ||
group: customized_dbt_model_group | ||
meta: | ||
dagster: | ||
asset_key: ["customized", "staging", "orders"] | ||
|
@@ -38,7 +38,7 @@ models: | |
|
||
- name: stg_payments | ||
config: | ||
group: customized_dbt_group | ||
group: customized_dbt_model_group | ||
meta: | ||
dagster: | ||
asset_key: ["customized", "staging", "payments"] | ||
|
5 changes: 5 additions & 0 deletions
5
...ries/dagster-dbt/dagster_dbt_tests/dbt_projects/test_dagster_meta_config/seeds/schema.yml
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,5 @@ | ||
groups: | ||
- name: customized_dbt_seed_group | ||
owner: | ||
name: Georg Bendemann | ||
email: [email protected] |