john-bodley commented on code in PR #21938:
URL: https://github.com/apache/superset/pull/21938#discussion_r1005080072
##########
superset/datasets/commands/duplicate.py:
##########
@@ -122,7 +120,7 @@ def validate(self) -> None:
exceptions.append(DatasetExistsValidationError(table_name=duplicate_name))
try:
- owners = self.populate_owners(self._actor)
Review Comment:
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](https://github.com/apache/superset/blob/f0ca158989644b793719884b52d04f93c05de1ba/superset/commands/base.py#L58)
there's no need to specify `[g.user.id]` given that it defaults to the current
user if not specified.
##########
superset/datasets/api.py:
##########
@@ -585,7 +585,7 @@ def duplicate(self) -> Response:
return self.response_400(message=error.messages)
try:
- new_model = DuplicateDatasetCommand([g.user.id], item).run()
Review Comment:
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](https://apache-superset.slack.com/archives/G013HAE6Y0K/p1666734311888839)
Slack thread for details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]