-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-6907] Simplify SchedulerJob #7527
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
Conversation
fe43697 to
d94f2f7
Compare
d94f2f7 to
b977200
Compare
Codecov Report
@@ Coverage Diff @@
## master #7527 +/- ##
=========================================
Coverage ? 86.57%
=========================================
Files ? 896
Lines ? 42634
Branches ? 0
=========================================
Hits ? 36910
Misses ? 5724
Partials ? 0
Continue to review full report at Codecov.
|
| .outerjoin(DM, DM.dag_id == TI.dag_id) | ||
| .filter(or_(DM.dag_id == None, # noqa: E711 pylint: disable=singleton-comparison | ||
| not_(DM.is_paused))) | ||
| .filter(or_(DM.dag_id.is_(None), not_(DM.is_paused))) |
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.
@nuclearpinguin This was an example of where we don't need a noqa anymore -- do you know why you did on your pylint fixes to jobs? Is it because we are ignoring this whole file?
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.
DM.dag_id == None => disable=singleton-comparison
DM.dag_id.is_(None) is correct syntax.
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.
Yeah I'm okay with this. My question is why in #7484 does he have
models.DagRun.state.is_(None))) # pylint: disable=no-member
but we don't need that here?
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.
(Sorry for not being clear. This comment was not about this PR, but about the other one)
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 don't know, but here we do not run pylint over this file, do we? @ashb
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.
It's still in TODO list:
https://github.com/PolideaInternal/airflow/blob/37c630da636d1ef352273e33fbdb417727914386/scripts/ci/pylint_todo.txt#L11
And I suppose that once I rebase onto new master I will have to fix it in more places...
| from googleapiclient.errors import HttpError | ||
|
|
||
| from airflow import AirflowException | ||
| from airflow.exceptions import AirflowException |
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.
Unrelated change here?
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.
Other than this, 👍 to the change.
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.
This change was already in the master, but the PR preview has not been updated.
If we realize that some methods always get one constant value, then their logic can be simplified.
Issue link: AIRFLOW-6907
Make sure to mark the boxes below before creating PR: [x]
[AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID** For document-only changes commit message can start with
[AIRFLOW-XXXX].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.
Read the Pull Request Guidelines for more information.