Uh oh!
There was an error while loading. Please reload this page.
Relax mandatory requirement for start_date when schedule=None - #35356
Conversation
There was a problem hiding this comment.
How can DagRunType be scheduled ? With scheduled runs we must have start_date
There was a problem hiding this comment.
How can DagRunType be scheduled ? With scheduled runs we must have start_date
IMHO it should be ok if catchup is False 🤔
There was a problem hiding this comment.
The scheduler creates runs with type scheduled. The fix in this PR is for manual runs that are created by the user.
catchup parameter has no affect on manual runs
There was a problem hiding this comment.
Updated DagRunType.SCHEDULED to DagRunType.MANUAL
There was a problem hiding this comment.
Yes, but I wonder if we can do the same thing for dags with schedule!=None if the catchup is set to False, wdyt?
There was a problem hiding this comment.
I dont think so because the first run depends on the start_date. If you set it in the past and interval passed when dag is activated it will create a run. If you set it for a future date then interval is not completed thus no run will be created when dag is set to active.
There was a problem hiding this comment.
yes, but we can consider that this condition is always met when the user does not provide a start date.
uranusjr
commented
Nov 6, 2023
Do we have a test for a non-None schedule raising an exception? |
@uranusjr Do we need to fail explicitly for non None Schedule and empty start date? In this case, it will start the job on the next schedule |
vishnucoder1
commented
Nov 10, 2023
Also want to mention that previously start date and task date were checked to throw the start date error which is part of add task. But schedule will not be empty then as it will be the default schedule interval value. |
vishnucoder1
commented
Nov 16, 2023
@uranusjr@eladkal@hussein-awala |
If I remember correctly, we currently fail explicitly for that combination, so it’s better to continue the behaviour. Having a DAG created silently but can never fire can be confusing for users. Task start dates are fine, just consider the DAG date. |
vishnucoder1
commented
Nov 17, 2023
Thanks for the input. Changes are added. |
eladkal
commented
Nov 17, 2023
Tests are failing: |
vishnucoder1
commented
Nov 18, 2023
Fixed the failing tests |
Uh oh!
There was an error while loading. Please reload this page.
* Relax mandatory requirement for start_date when schedule=None * Updated run_type in unit tests * Added check for empty start_date and non empty schedule * Fix the build failures * Fix the build failures * Update based on review comments (cherry picked from commit 930f165)
`start_date` is now optional, if there is no schedule for the DAG (apache#35356). Tasks, however, inherit the `start_date` of their DAG by default. So it's now possible for tasks to have no `start_date` as well. Closes: apache#40828
As a part of this PR, existing
start_datevalidation is removed to handleschedule=NoneCloses: #35199