-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Apply PROVIDE_PROJECT_ID mypy workaround across Google provider #39129
Conversation
cc: @VladaZakharova |
cc: @moiseenkov |
ec62247
to
e42f8aa
Compare
There is a simple workaround implemented several years ago for Google provider `project_id` default value being PROVIDE_PROJECT_ID that satisfy mypy checks for project_id being set. They way how `fallback_to_default_project_id` works is that across all the providers the project_id is actually set, even if technically it's default value is set to None. This is similar typing workaround as we use for NEW_SESSION in the core of Airflow. The workaround has not been applied consistently across all the google provider code and occasionally it causes MyPy complaining when newer version of a google library introduces more strict type checking and expects the provider_id to be set. This PR applies the workaround across all the Google provider code. This is - generally speaking a no-op operation. Nothing changes, except MyPy being aware that the project_id is actually going to be set even if it is technically set to None.
e42f8aa
to
5d1b885
Compare
Rerunning with upgrade + full tests needed just in case. |
Random /flaky failure . Merging. All looks good. In the future (providing we keep the approach) it should not cause unexpected mypy issues. |
There is a simple workaround implemented several years ago for Google provider `project_id` default value being PROVIDE_PROJECT_ID that satisfy mypy checks for project_id being set. They way how `fallback_to_default_project_id` works is that across all the providers the project_id is actually set, even if technically it's default value is set to None. This is similar typing workaround as we use for NEW_SESSION in the core of Airflow. The workaround has not been applied consistently across all the google provider code and occasionally it causes MyPy complaining when newer version of a google library introduces more strict type checking and expects the provider_id to be set. This PR applies the workaround across all the Google provider code. This is - generally speaking a no-op operation. Nothing changes, except MyPy being aware that the project_id is actually going to be set even if it is technically set to None. (cherry picked from commit 90acbfb)
cc: @ephraimbuddy @jedcunningham -> I cherry-picked that one to |
There is a simple workaround implemented several years ago for Google provider
project_id
default value being PROVIDE_PROJECT_ID that satisfy mypy checks for project_id being set. They way howfallback_to_default_project_id
works is that across all the providers the project_id is actually set, even if technically it's default value is set to None.This is similar typing workaround as we use for NEW_SESSION in the core of Airflow.
The workaround has not been applied consistently across all the google provider code and occasionally it causes MyPy complaining when newer version of a google library introduces more strict type checking and expects the provider_id to be set.
This PR applies the workaround across all the Google provider code.
This is - generally speaking a no-op operation. Nothing changes, except MyPy being aware that the project_id is actually going to be set even if it is technically set to None.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.