-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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 last remaining MyPy errors #21020
Conversation
Seems like this one will also be a collaborative effort eventually, There are a few errors around "airflow.models.decorators" package which I am not entirely sure why they are there and whether I made the right fix. The one remaining - after I think I solved all other is
But I am not sure if the fixes are added are good. Seems like |
5ba976e
to
705b26f
Compare
The naming and structuring of |
Ehh. so you will be the last one :) |
705b26f
to
b6b4116
Compare
@uranusjr - removed it. Let's do it this way - since I also want to re-enable mypy and we should wait a few days with some "older PRs" to get "no-rebase" warning, I will continue rebasing that one until it gets "green". So feel free to unentangle the "decorators" disaster in the meantime |
4cf9fbc
to
25e2a1e
Compare
|
||
assert isinstance(data, list) | ||
assert len(data) == 0 | ||
with pytest.raises(ValueError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight doubt about this one. This is "technically" breaking change with the experimental API, but one that should be very welcomed by any user. So I am tempted to leave it like that (I would treat it as a bugfix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What bit throws the value error here? (It's not clear to from just looking at the code)
Oh, that state=dummy
results in a ValueError -- wouldn't that result in a 500 returned, when instead it should be a 400?
All right @uranusjr . Decorators are all yours:
|
25e2a1e
to
931babd
Compare
Right - rebased and fixed last two errors: @uranusjr @ashb - I fixed two small thing (not even errors but inconsistencies and MyPy complaints in the new The errors were:
|
none_depends_on_past = all(not t.task.depends_on_past for t in unfinished_tasks) | ||
none_task_concurrency = all(t.task.max_active_tis_per_dag is None for t in unfinished_tasks) | ||
none_depends_on_past = all( | ||
not t.task.depends_on_past for t in unfinished_tasks # type: ignore[has-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this needs type ignoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, t.task
could be None as far as typing is concenred?
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. |
|
Closes: #19891
^ 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.