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

Added missing typings. #2123

Merged
merged 4 commits into from
May 17, 2022
Merged

Added missing typings. #2123

merged 4 commits into from
May 17, 2022

Conversation

dblock
Copy link
Member

@dblock dblock commented May 14, 2022

Signed-off-by: dblock [email protected]

Description

  • Added missing types.
  • Enabled mypy in the complete python codebase.

Issues Resolved

Closes #1513
Closes #1512
Closes #1237

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dblock dblock requested a review from a team as a code owner May 14, 2022 12:46
@dblock dblock requested review from peterzhuamazon and zelinh May 14, 2022 12:53
@codecov-commenter
Copy link

codecov-commenter commented May 14, 2022

Codecov Report

Merging #2123 (3960eb6) into main (4fc0805) will increase coverage by 0.35%.
The diff coverage is 96.47%.

@@             Coverage Diff              @@
##               main    #2123      +/-   ##
============================================
+ Coverage     94.21%   94.56%   +0.35%     
  Complexity       25       25              
============================================
  Files           204      205       +1     
  Lines          3943     4254     +311     
  Branches         29       29              
============================================
+ Hits           3715     4023     +308     
- Misses          222      225       +3     
  Partials          6        6              
Impacted Files Coverage Δ
src/build_workflow/build_target.py 100.00% <ø> (ø)
src/run_bwc_test.py 87.50% <66.66%> (+0.83%) ⬆️
src/run_integ_test.py 87.50% <66.66%> (+0.83%) ⬆️
src/test_workflow/test_recorder/test_recorder.py 63.63% <73.46%> (+5.42%) ⬆️
src/test_workflow/perf_test/perf_test_runner.py 95.00% <88.88%> (-5.00%) ⬇️
src/test_workflow/bwc_test/bwc_test_runner.py 92.50% <94.11%> (+0.19%) ⬆️
src/test_workflow/integ_test/integ_test_runner.py 97.50% <94.11%> (-2.50%) ⬇️
src/test_workflow/test_cluster.py 88.57% <96.00%> (+5.55%) ⬆️
src/test_workflow/integ_test/service.py 92.94% <96.42%> (-0.12%) ⬇️
src/test_workflow/perf_test/perf_test_cluster.py 85.05% <96.77%> (+5.05%) ⬆️
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fc0805...3960eb6. Read the comment docs.

@dblock dblock requested a review from gaiksaya May 16, 2022 15:50
def __init__(self, path):
dependency_installer: DependencyInstallerOpenSearch

def __init__(self, path: str):
Copy link
Member

Choose a reason for hiding this comment

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

This method should also return None?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, so why isn’t mypi failing on this? Any ideas?

Copy link
Member Author

@dblock dblock May 17, 2022

Choose a reason for hiding this comment

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

Found the answer in https://mypy.readthedocs.io/en/stable/common_issues.html

init method has no annotated arguments or return type annotation. init is considered fully-annotated if at least one argument is annotated, while mypy will infer the return type as None.

To be consistent, added missing annotations in a8832cb

Copy link
Member

Choose a reason for hiding this comment

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

I was wondering the same thing. Thanks for the explanation!

@dblock dblock requested a review from zelinh May 17, 2022 11:48
Copy link
Member

@zelinh zelinh left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@dblock dblock merged commit 7940888 into opensearch-project:main May 17, 2022
@dblock dblock deleted the typings branch May 17, 2022 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants