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
style(mypy): Enforcing typing for views.database #9920
style(mypy): Enforcing typing for views.database #9920
Conversation
superset/views/database/filters.py
Outdated
self, query, func | ||
): # noqa pylint: disable=unused-argument,arguments-differ | ||
def apply( # noqa pylint: disable=unused-argument | ||
self, query: Query, value: Optional[Any] |
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 renamed func
to value
for consistency with the base class.
self._pre_add_update(database) | ||
|
||
def pre_delete(self, obj): # pylint: disable=no-self-use | ||
if obj.tables: | ||
def pre_delete(self, database: Database) -> None: # pylint: disable=no-self-use |
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 renamed obj
to database
for consistency.
Codecov Report
@@ Coverage Diff @@
## master #9920 +/- ##
=======================================
Coverage 71.31% 71.32%
=======================================
Files 585 585
Lines 30874 30876 +2
Branches 3236 3236
=======================================
+ Hits 22019 22023 +4
+ Misses 8746 8744 -2
Partials 109 109
Continue to review full report at Codecov.
|
28b8e5f
to
529566d
Compare
529566d
to
b6b2ed3
Compare
@expose( | ||
"/<int:pk>/table/<string:table_name>/<string:schema_name>/", methods=["GET"] | ||
) | ||
@expose("/<int:pk>/table/<table_name>/<schema_name>/", methods=["GET"]) |
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.
Note per here string
is the default converter type and thus doesn't need to be explicitly defined. This is consistent with other views.
Co-authored-by: John Bodley <john.bodley@airbnb.com>
SUMMARY
Adding
mypy
type enforcement for thesuperset.views.database
module. Note because thesuperset.views
module is quite large I opted to break the type enforcement into smaller more digestible chunks.TEST PLAN
CI.
ADDITIONAL INFORMATION