Skip to content
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

fix: Upgrade mypy version to build with Python3.8 #975

Merged
merged 2 commits into from
Apr 20, 2021
Merged

fix: Upgrade mypy version to build with Python3.8 #975

merged 2 commits into from
Apr 20, 2021

Conversation

sewardgw
Copy link
Contributor

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 make amundsenfrontend compatible with Python3.8. The prior version of mypy 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 new mypy infers all dict.get(...) methods to be Optional an in order to meet function signatures changes were made from:

my_dict.get('val')

to

my_dict['val']

The scenarios where these occur are only where the dictionary is guaranteed to contain the key.

In addition, the signature for the BaseMailClient function send_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 in None 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.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes, including screenshots of any UI changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public python functions and the classes in the PR contain docstrings that explain what it does
  • PR passes all tests documented in the developer guide

Signed-off-by: Grant Seward <grant@stemma.ai>
Copy link
Contributor

@dorianj dorianj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Can the github workflow be updated to test on 3.8 as well?

@sewardgw
Copy link
Contributor Author

Yep - adding it now

Signed-off-by: Grant Seward <grant@stemma.ai>
@dorianj dorianj merged commit 18963ec into amundsen-io:master Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants