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

Clear out MyPy's warnings #1581

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

e10e3
Copy link
Contributor

@e10e3 e10e3 commented Jul 23, 2024

When type checking the code, MyPy raises some warnings:

river/drift/kswin.py:112: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
river/tree/nodes/sgt_nodes.py:45: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
river/tree/nodes/hatc_nodes.py:140: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
river/tree/stochastic_gradient_tree.py:56: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
river/forest/aggregated_mondrian_forest.py:173: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
river/forest/aggregated_mondrian_forest.py:293: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Success: no issues found in 465 source files

These warnings are the result of inconsistencies in the annotations, but are not errors because MyPy does not check untyped functions by default.

The inconsistencies can be cleared by adding or correcting annotations: with the changes of this PR applied, no warnings are raised any more by MyPy.

Type annotations are added to some functions; this allows to remove
MyPy's warnings when typechecking the code by clearing some
inconsistencies.

A couple incorrect or extraneous annotations were removed in the
process.
Copy link
Member

@smastelini smastelini left a comment

Choose a reason for hiding this comment

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

Thanks for looking into that, @e10e3 ! LGTM!

@smastelini smastelini merged commit e181e38 into online-ml:main Jul 23, 2024
4 checks passed
@e10e3 e10e3 deleted the clear-mypy-warnings branch July 23, 2024 12:10
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