-
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.
Enable "owners" parameter for graph assets (#21358)
## Summary & Motivation Closes #21356. Follows example #21272 ## How I Tested These Changes Added unit test
- Loading branch information
Showing
4 changed files
with
22 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
asset, | ||
multi_asset, | ||
) | ||
from dagster._core.definitions.assets import TeamAssetOwner, UserAssetOwner | ||
from dagster._core.definitions.auto_materialize_policy import AutoMaterializePolicy | ||
from dagster._core.definitions.decorators.config_mapping_decorator import config_mapping | ||
from dagster._core.definitions.policy import RetryPolicy | ||
|
@@ -882,6 +883,7 @@ def my_graph(x, y): | |
@ignore_warning("Function `AutoMaterializePolicy.lazy` is deprecated") | ||
@ignore_warning("Parameter `resource_defs` .* is experimental") | ||
@ignore_warning("Parameter `tags` .* is experimental") | ||
@ignore_warning("Parameter `owners` .* is experimental") | ||
def test_graph_asset_with_args(): | ||
@resource | ||
def foo_resource(): | ||
|
@@ -902,6 +904,7 @@ def my_op2(y): | |
auto_materialize_policy=AutoMaterializePolicy.lazy(), | ||
resource_defs={"foo": foo_resource}, | ||
tags={"foo": "bar"}, | ||
owners=["team:team1", "[email protected]"], | ||
) | ||
def my_asset(x): | ||
return my_op2(my_op1(x)) | ||
|
@@ -912,6 +915,10 @@ def my_asset(x): | |
maximum_lag_minutes=5 | ||
) | ||
assert my_asset.tags_by_key[AssetKey("my_asset")] == {"foo": "bar"} | ||
assert my_asset.owners_by_key[AssetKey("my_asset")] == [ | ||
TeamAssetOwner("team1"), | ||
UserAssetOwner("[email protected]"), | ||
] | ||
assert ( | ||
my_asset.auto_materialize_policies_by_key[AssetKey("my_asset")] | ||
== AutoMaterializePolicy.lazy() | ||
|