-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add type hints to HttpResponse
#94
Conversation
@tonybaloney - I think this change will need a corresponding change in =================================== FAILURES ===================================
__________________________ TestCodeQuality.test_mypy ___________________________
Traceback (most recent call last):
File "/home/runner/work/azure-functions-python-library/azure-functions-python-library/tests/test_code_quality.py", line 32, in test_mypy
f'mypy validation failed:\n{output}') from None
AssertionError: mypy validation failed:
azure/functions/_http_asgi.py:73: error: Argument "headers" to "HttpResponse" has incompatible type "Union[Headers, Dict[Any, Any]]"; expected "Optional[Mapping[str, str]]"
Found 1 error in 1 file (checked 45 source files) |
@vrdmr @tonybaloney I have ignored the error for the moment following similar code in A proper solution would be to make a consistent usage of the |
@vrdmr @gavin-aguiar Any updates here? Since the |
@AnatoliB @anirudhgarg @gavin-aguiar Could you have a look on this PR as required reviewers? Ps.: @vrdmr It seems tests are failing/cancelling across all builds and are not related to this PR only. |
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.
LGTM.
Thanks a lot, @michelole for the contribution, and apologies for the delay. I'll fix the CI issues with our workflow caused due to a PR coming from a fork. Thanks again. |
It seems
HttpResponse
is the only class in this file that does not contain type hints.This generates errors when client code is checked using
mypy
in strict mode:Add type hints following the docstring.