-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bugfix] asset owner copying #19880
[bugfix] asset owner copying #19880
Conversation
0fd5f34
to
44b4cc7
Compare
44b4cc7
to
a613a50
Compare
272f436
to
671dd81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! See one comment before merging.
@@ -2062,9 +2062,9 @@ def test_asset_owners(): | |||
def my_asset(): | |||
pass | |||
|
|||
assert my_asset.owners_by_key == { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my_asset
, can we also test passing in TeamAssetOwner
and UserAssetOwner
instantiated objects?
671dd81
to
af90902
Compare
@smackesey thanks for fixing this 🙌 |
## Summary & Motivation The recently added `owners_by_key` field on `AssetsDefinition` breaks when copying an `AssetsDefinition`. Calling `with_attributes` on an `AssetDefinition` that had defined assets owners would trigger a runtime error due to performance of string operations on `{Team,User}AssetOwner` objects. Also the type annotation was incorrect for `owners_by_key`. This fixes the bug. ## How I Tested These Changes Add test for copying owners.
Summary & Motivation
The recently added
owners_by_key
field onAssetsDefinition
breaks when copying anAssetsDefinition
. Callingwith_attributes
on anAssetDefinition
that had defined assets owners would trigger a runtime error due to performance of string operations on{Team,User}AssetOwner
objects. Also the type annotation was incorrect forowners_by_key
. This fixes the bug.How I Tested These Changes
Add test for copying owners.