fix: Upgrade mypy version to build with Python3.8 #975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Grant Seward grant@stemma.ai
This PR addresses issue: amundsen-io/amundsen#974
Summary of Changes
This PR updates the version of
mypy
in order to makeamundsenfrontend
compatible with Python3.8. The prior version ofmypy
had a bug that prevented it from being installed in Python3.8 but this bug was resolved in 2019. The version was bumped to the newest mypy version (.812), simply because the other Amundsen services were not already aligned on a specific version but I can see that it would also make sense to match the metadata service version (.782). I'll look for feedback here.There are no material impacts to the code as part of this PR and the majority of the changes are to add explicit typing to several tests. However, the newer version of
mypy
requires more explicit typing in a few places and therefore there have been a few places where the formatting of the code has been updated. An example of this is that the newmypy
infers alldict.get(...)
methods to beOptional
an in order to meet function signatures changes were made from:to
The scenarios where these occur are only where the dictionary is guaranteed to contain the key.
In addition, the signature for the
BaseMailClient
functionsend_email
was updated to be more inline with the example that implements the base client. Optional data, sender and recipient are all now optional. This also conforms to the existing tests which pass inNone
for these three arguments.In a few of the more-complex cases
# type: ignore
was added.Tests
No new tests were added but several tests were refactored / consolidated.
Documentation
n/a
CheckList
Make sure you have checked all steps below to ensure a timely review.