-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Add run_type to DagRun #8227
Add run_type to DagRun #8227
Conversation
airflow/migrations/versions/3c20cacc0044_add_dagrun_run_type.py
Outdated
Show resolved
Hide resolved
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.
dag.create_run()
is a quasi-public API so we should probably mention this change in updating.md?
Looks good, just need to work out what is the best index to put on the new run_type column.
Oh and we should add the run_type column to the DAGRunModelView. |
6e2e65e
to
01b339e
Compare
01b339e
to
a5b36b7
Compare
Codecov Report
@@ Coverage Diff @@
## master #8227 +/- ##
=========================================
+ Coverage 6.22% 6.24% +0.01%
=========================================
Files 946 941 -5
Lines 45695 45667 -28
=========================================
+ Hits 2846 2851 +5
+ Misses 42849 42816 -33
Continue to review full report at Codecov.
|
a5b36b7
to
ed5618c
Compare
dag_id | ||
)) | ||
run_type = DagRunType.MANUAL | ||
dag_run = dag_run.find(dag_id=dag_id, run_type=run_type, execution_date=execution_date) |
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.
Is there is already a scheduled dag_run for this exact time but of a different run_type, this find()
will fail to find anything, but the unique constraint (on exeuction_date, dag_id) would still be violated.
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 will fix it
@turbaszek Is it much work to run your benchmark again:
Yeah, it's cos sometimes that makes sense cos all users share the same view (sorting, filtering, maybe you want to hide colums from some users etc). Annoying for like 80% of the time though! |
I will run those tests today / tomorrow |
Cool, thanks. I don't expect this to make a difference, but if it's easy to check let's do it |
Assuming that we query all combination of (dag_id, run_id, state) + run_typ != Backfill we get
@ashb I've updated the spreadsheet, as expected there's nothing that would favor another index than the current one. |
21e288c
to
3a018fd
Compare
3a018fd
to
6bcf2ae
Compare
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.
One small change, then LGTM!
(Oh plus fixing the failing test 😉)
Thanks @ashb , your comments are addressed 👌 |
34d27bc
to
2a22ee0
Compare
fixup! Add run_type to DagRun fixup! fixup! Add run_type to DagRun fixup! fixup! fixup! Add run_type to DagRun fixup! fixup! fixup! Add run_type to DagRun fixup! Add run_type to DagRun fixup! Add run_type to DagRun Adjust TriggerDagRunOperator fixup! Adjust TriggerDagRunOperator Add index Make run_type not nullable Add type check for run_type fixup! Add type check for run_type
6a5ff8c
to
70e9dd0
Compare
Thanks all! |
🎉 |
https://issues.apache.org/jira/browse/AIRFLOW-6242
Make sure to mark the boxes below before creating PR: [x]
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.