Skip to content

Fix CLI commands when custom timetable is used#32118

Merged
uranusjr merged 15 commits into
apache:mainfrom
utkarsharma2:FixCustomTimetable
Jul 10, 2023
Merged

Fix CLI commands when custom timetable is used#32118
uranusjr merged 15 commits into
apache:mainfrom
utkarsharma2:FixCustomTimetable

Conversation

@utkarsharma2

@utkarsharma2 utkarsharma2 commented Jun 24, 2023

Copy link
Copy Markdown
Contributor

Currently, there are CLI commands that are failing when passing a custom timetable. Following the example in the tutorial - https://airflow.apache.org/docs/apache-airflow/stable/howto/timetable.html and running the following commands will result in an error - ValueError: Not a valid timetable: <workday.AfterWorkdayTimetable object at 0x7f50f9cd1700>

  1. airflow dags backfill <dag_id> -s -e --dry-run (works fine without --dry-run)
  2. airflow dags test <dag_id> [date]
  3. airflow tasks render <dag_id> <task_id> (works fine if you pass a valid run_id instead of an execution_date)

The failure is due to missing data_interval when creating the DagRun object. The PR aims at adding data_interval when we are creating DagRun.

@utkarsharma2
utkarsharma2 marked this pull request as draft June 24, 2023 18:32
@utkarsharma2

utkarsharma2 commented Jun 24, 2023

Copy link
Copy Markdown
Contributor Author

@uranusjr please check, I'm yet to add test cases for these changes. But I just wanted to confirm there are no side effects of these changes :)

Comment thread airflow/cli/commands/dag_command.py Outdated
@uranusjr

Copy link
Copy Markdown
Member

Other changes look correct to me.

Comment thread airflow/cli/commands/dag_command.py Outdated
@uranusjr
uranusjr force-pushed the FixCustomTimetable branch from f076a05 to 58f7810 Compare July 3, 2023 09:31
@utkarsharma2
utkarsharma2 marked this pull request as ready for review July 10, 2023 06:16
@utkarsharma2
utkarsharma2 requested a review from uranusjr July 10, 2023 06:59
@uranusjr

Copy link
Copy Markdown
Member

Check failures are unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Timetable breaks a handful of CLI commands

4 participants