-
Notifications
You must be signed in to change notification settings - Fork 189
[mypy] Enforce Mypy checks for a subset of modules #208
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,20 @@ test=pytest | |
[flake8] | ||
max-line-length = 120 | ||
# W503 raises a warning when there is a line break before a binary operator. | ||
# This is best practice according to PEP 8 and the rule should be ignored. | ||
# This is best practice according to PEP 8 and the rule should be ignored. | ||
# | ||
# https://www.flake8rules.com/rules/W503.html | ||
# https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator | ||
ignore = W503 | ||
|
||
[mypy] | ||
check_untyped_defs = true | ||
disallow_any_generics = true | ||
disallow_untyped_calls = true | ||
disallow_untyped_defs = true | ||
ignore_missing_imports = true | ||
no_implicit_optional = true | ||
warn_unused_ignores = true | ||
|
||
[mypy-tests.*,trino.auth,trino.client,trino.dbapi,trino.sqlalchemy.*] | ||
ignore_errors = true | ||
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why mypy errors are ignored it these packages? For instance I see that you addressed some in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hashhar
the TL;DR is for the |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -492,7 +492,7 @@ def statement_url(self) -> str: | |
def next_uri(self) -> Optional[str]: | ||
return self._next_uri | ||
|
||
def post(self, sql, additional_http_headers=None): | ||
def post(self, sql: str, additional_http_headers: Optional[Dict[str, Any]] = None): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As of yet I'm unsure of the return type. This should become clearer when the module has type enforcement. This method (as well as |
||
data = sql.encode("utf-8") | ||
# Deep copy of the http_headers dict since they may be modified for this | ||
# request by the provided additional_http_headers | ||
|
@@ -524,7 +524,7 @@ def post(self, sql, additional_http_headers=None): | |
) | ||
return http_response | ||
|
||
def get(self, url): | ||
def get(self, url: str): | ||
return self._get( | ||
url, | ||
headers=self.http_headers, | ||
|
Uh oh!
There was an error while loading. Please reload this page.