Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Dec 2, 2021

And to fix these, I needed to fix a few other mistakes that are
used/called by DAG's methods.

Relates to #19891 - it doesn't completely fix any packages, but this change was getting larger.

/cc @khalidmammadov

@ashb

This comment has been minimized.

@potiuk
Copy link
Member

potiuk commented Dec 3, 2021

AH NOOO!!!!!! I MISSED THE #20000 one! Bummer!

@uranusjr
Copy link
Member

uranusjr commented Dec 3, 2021

It’s probably because Pendulum invents its own timezone class (which is fine) and expects to only receive that timezone class in its own datetime class (which is not fine). I’ll take a look.

@ashb ashb force-pushed the models-typing-partial branch 2 times, most recently from 0680d24 to 4387320 Compare December 3, 2021 08:47
@uranusjr uranusjr force-pushed the models-typing-partial branch from 268bf7b to dd2b124 Compare December 3, 2021 10:18
@ashb ashb force-pushed the models-typing-partial branch from d061138 to 14d3d35 Compare December 3, 2021 18:25
@ashb ashb changed the title Fix many of the mypy typing issues in airflow.models.dag Fix many of the mypy typing issues in airflow.models Dec 3, 2021
Comment on lines -564 to +583
Copy link
Member

Choose a reason for hiding this comment

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

For other reviewers wondering, this method returns a command list (for e.g. subprocess), and passing in a None would not work, so all existing usages of this function should already be passing in a run_id, making this change safe.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Dec 7, 2021
@github-actions
Copy link

github-actions bot commented Dec 7, 2021

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.

@ashb ashb changed the title Fix many of the mypy typing issues in airflow.models Improve handling edge-cases in airlfow.models by applying mypy Dec 7, 2021
@ashb ashb force-pushed the models-typing-partial branch from ba59f07 to 52e459a Compare December 7, 2021 10:46
@ashb
Copy link
Member Author

ashb commented Dec 7, 2021

I might need to merge #20079 first -- this is crashing in building docs for some reason.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what is causing the docs build to fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have a fix for it -- so we can merge this and spend a bit more time looking at the sphinx upgrade.

@ashb ashb force-pushed the models-typing-partial branch from d6a3fb2 to b324cbd Compare December 7, 2021 14:07
ashb and others added 2 commits December 7, 2021 15:13
And to fix these, I needed to fix a few other mistakes that are
used/called by DAG's methods
Also moved the sentinel value implementation to a utils module. This
should be useful when fixing typing issues in other modules.
@ashb
Copy link
Member Author

ashb commented Dec 7, 2021

Conflict is only in the import section:

<<<<<<< models-typing-partial
from airflow.utils.session import NEW_SESSION, create_session, provide_session
=======
from airflow.utils.retries import run_with_db_retries
from airflow.utils.session import create_session, provide_session
>>>>>>> main

so once these tests pass I'll fix conflict then merge without waiting for another test run.

@ashb
Copy link
Member Author

ashb commented Dec 7, 2021

Green build https://github.com/apache/airflow/actions/runs/1549766290 -- rebasing + merging.

@ashb ashb force-pushed the models-typing-partial branch from b324cbd to fef2974 Compare December 7, 2021 15:27
@ashb ashb merged commit 7d8e3b8 into apache:main Dec 7, 2021
@ashb ashb deleted the models-typing-partial branch December 7, 2021 15:28
@potiuk potiuk added the mypy Fixing MyPy problems after bumpin MyPy to 0.990 label Dec 13, 2021
@kaxil kaxil added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 mypy Fixing MyPy problems after bumpin MyPy to 0.990

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants