-
Notifications
You must be signed in to change notification settings - Fork 16.4k
UI: Add data interval override option for manual DAG runs #57342
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
UI: Add data interval override option for manual DAG runs #57342
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
78b33a9 to
9f90dcc
Compare
|
Is there a practical use for data interval start/end in your use case that you need it for? Other than adding consistentcy? In my view the parameters are mainly covered for histporical scheduled use cases to define the data intervals. Manually triggering a Dag is in almost all cases (looking for an exception) out of such interval bounds. I am asking for a real use case because the trigger form is already over-loaded with options (in my view) and I fear that there are more users confused by the options than it brings a benefit. I'd accept it if there is a real use case driving this addition. There might be. |
@jscheffl Hi Jens, thanks for your response. Indeed, I do have a use-case in mind! We have a DAG responsible for doing some data aggregation over some time series data. It is scheduled on a custom timetable: It runs once a day, and uses a data interval covering the previous 72 hours. What we would like to do is run a backfill, but a "normal" backfill would be wasteful as it would process data for each day three times (since the data intervals for consecutive runs overlap). So it would be useful to be able to trigger the DAG manually but with a custom data interval, that is different than the default one set in the timetable. Of course we could create a separate DAG just for the purpose of backfilling, but that doesn't feel as neat as using the same DAG. Here is how I understand the use cases for manually triggering DAG runs:
Of course that is my interpretation based on our narrow use-case 😆. We haven't been using Airflow for long so I understand that our usage might differ from the majority of users |
Thanks. This sounds a bit like a special case. So calling via API might be resonable for you, not 100% sure if it makes sense to extend the UI for such niece use case. |
|
Not speaking to the implementation, but if the API allows specifying data_interval than I'm +1 to allowing the UI user to specify it too. If we think most users won't want this we could think about hiding it behind an "Advanced" collapsed-by-default section.
This is a use case I've had in the past, and was in some of the inspiration for creating explicit data_interval range distinct from the logical date of the dag run. |
pierrejeambrun
left a comment
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.
Yes the API accepts both data_interval_start and data_interval_end, and I'm fine adding that to the form.
Can you address the remaining comments and fix the CI so we can move forward with the PR please?
airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGForm.tsx
Outdated
Show resolved
Hide resolved
|
My usecase is probably also "special". We are in dev phase of project and we would like to have ability to trigger custom data interval just for testing. We test dag locally, then we deploy it to AWS and we would like to test it in AWS as well. |
pierrejeambrun
left a comment
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.
@bastienmenis Any chance you can address the comments so we can get his merged?
Also address the backend part that need some tweaking
0b006c3 to
1b6a180
Compare
@pierrejeambrun I will try to have a look at this at some point this week. |
d2f947c to
f27775c
Compare
|
I have reworked the changes and committed a bigger refactor. I believe it would be a significant UX improvement. The PR description has been updated accordingly (with screenshots this time!). I didn't update the backend as it is not strictly related to the changes in this pull request. |
pierrejeambrun
left a comment
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.
Nice thanks.
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* Add data interval start and end to TriggerDAGForm * Update API call * Fix margins * Update "Trigger Dag" form
* Add data interval start and end to TriggerDAGForm * Update API call * Fix margins * Update "Trigger Dag" form
This PR modifies the modal for triggering a single DAG run manually. The primary change is to allow the user to specify the data interval manually.
List of changes:
data_interval_startanddata_interval_endasnullin the API call (same as current behaviourTriggerDAGForminto two components, breakingTriggerDGAdvancedOptionsto its own file.components.json. I am not familiar with the process for adding translations, or any related automations; I have only included the English one.*Screenshots

DAG with time table - Default option:
DAG with time table - Manual interval:

DAG without time table:

Reasoning behind this change
data_interval_startanddata_interval_endare optional when making the API call. This is not transparent to the user, I think it would be better UX if the user can see and alter the data interval that will be used when triggering a DAG.** Possible future improvements **
When selecting "Inferred Data Interval", it would be better UX to display to the user what this inferred interval is. It could be achieved by adding an API endpoint could be added to fetch the data interval for a specified logical date.
^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.