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 new MyPy errors in main #22884

Merged
merged 1 commit into from
Apr 10, 2022
Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Apr 10, 2022

Those MyPe errors are side effect of some new dependencies.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added area:CLI area:core-operators Operators, Sensors and hooks within Core Airflow area:dev-tools provider:cncf-kubernetes Kubernetes provider related issues area:logging area:providers provider:amazon-aws AWS/Amazon - related issues provider:google Google (including GCP) related issues labels Apr 10, 2022
@potiuk
Copy link
Member Author

potiuk commented Apr 10, 2022

BTW. A number of those errors (except the big google Retry) are because MyPy has quite a big problem with recognizing that for example our airflow.providers.grpc module is not the same as grpc . This is because provider's module is implicit and somehow mypy things that grpc is the top-level module (same with jenkins and few others). We will have to solve it better when we split providers from the core.

Those MyPe errors are side effect of some new dependencies.
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Apr 10, 2022
@potiuk potiuk merged commit 6933022 into apache:main Apr 10, 2022
@potiuk potiuk deleted the fix-newer-mypy-issues branch April 10, 2022 14:45
@malthe
Copy link
Contributor

malthe commented Apr 10, 2022

Why are template_fields and template_ext now sequences and not instead Iterable – ?

If someone wants a deterministic order, then can use a list or tuple as the value.

@potiuk
Copy link
Member Author

potiuk commented Apr 10, 2022

Why are template_fields and template_ext now sequences and not instead Iterable – ?

If someone wants a deterministic order, then can use a list or tuple as the value.

I just fixed consistency. I think there is no particular reason. I do not think it matters as long as it consistent. You can make a PR to change it ti Iterable -but it has to be consistent in all providers and code.

@potiuk
Copy link
Member Author

potiuk commented Apr 10, 2022

It also could be that somewhere in the code len() is used and that would make it not good candidate for Iterable.

@malthe
Copy link
Contributor

malthe commented Apr 10, 2022

@potiuk from the description of those attributes, I don't see why any code would do len() on it. It seems you've got to iterate until you find a match or keep trying.

@malthe malthe assigned malthe and unassigned malthe Apr 10, 2022
@malthe malthe removed their assignment Apr 10, 2022
@malthe malthe self-requested a review April 10, 2022 15:28
@potiuk
Copy link
Member Author

potiuk commented Apr 10, 2022

Yeah. Could be :) . I do not see any problem with changing it to Iterable if it passes all the tests. I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI area:core-operators Operators, Sensors and hooks within Core Airflow area:dev-tools area:logging area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) full tests needed We need to run full set of tests for this PR to merge provider:amazon-aws AWS/Amazon - related issues provider:cncf-kubernetes Kubernetes provider related issues provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants