-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
chore: Refactor ownership #21938
chore: Refactor ownership #21938
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21938 +/- ##
===========================================
+ Coverage 55.55% 66.92% +11.37%
===========================================
Files 1806 1806
Lines 69140 69156 +16
Branches 7393 7393
===========================================
+ Hits 38409 46284 +7875
+ Misses 28822 20963 -7859
Partials 1909 1909
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
62a662e
to
4d546c7
Compare
@@ -585,7 +585,7 @@ def duplicate(self) -> Response: | |||
return self.response_400(message=error.messages) | |||
|
|||
try: | |||
new_model = DuplicateDatasetCommand([g.user.id], item).run() |
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.
This was wrong. It was passing in a List[int]
whereas the class signature expected User
. I'm somewhat perplexed as to why Mypy didn't report this an error. See this Slack thread for details.
@@ -122,7 +120,7 @@ def validate(self) -> None: | |||
exceptions.append(DatasetExistsValidationError(table_name=duplicate_name)) | |||
|
|||
try: | |||
owners = self.populate_owners(self._actor) |
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.
See the previous comment. I gather Mypy didn't barf because it was being passed List[int]
as opposed to User
per the class __init__
method.
Note, per here there's no need to specify [g.user.id]
given that it defaults to the current user if not specified.
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.
I tried to think of any reason for this to be passed through, but couldn't come up with any valid reason, so I must assume it's not needed. And if this does indeed break something we need to add an IT for it anyway. LGTM.
SUMMARY
A follow up to #20499 where the
actor
field was deprecated given this is simply the current logged in user.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION