dpgaspar commented on a change in pull request #9418: [mypy] Enforcing typing
for superset.dashboards
URL:
https://github.com/apache/incubator-superset/pull/9418#discussion_r404238484
##########
File path: superset/dashboards/commands/bulk_delete.py
##########
@@ -40,7 +40,7 @@ def __init__(self, user: User, model_ids: List[int]):
self._model_ids = model_ids
self._models: Optional[List[Dashboard]] = None
- def run(self):
+ def run(self) -> None:
Review comment:
Ended up reverting typing on command to more explicit type, following
@villebro comments and reasoning around:
- We want to migrate logic implemented on models to commands and the return
types for `Command.run()` will vary a lot
- `Optional[Model]` will not cover all future use cases and will force us to
implement logic that is unnecessary such has testing if the `run` method
returned something, when it will always return of raise
- We will not be able to implement a single return type for all
`Command.run()` unless creating a very big type definition
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]