CLI command "airflow dags next-execution" give unexpected results with paused DAG and catchup=False
See original GitHub issueApache Airflow version
2.2.2
What happened
Current time 16:54 UTC Execution Schedule: * * * * * Last Run: 16:19 UTC DAG Paused Catchup=False
airflow dags next-execution sample_dag
returns
[INFO] Please be reminded this DAG is PAUSED now.
2022-03-22T16:20:00+00:00
What you think should happen instead
I would expect
[INFO] Please be reminded this DAG is PAUSED now.
2022-03-22T16:53:00+00:00
To be returned since when you unpause the DAG that is the next executed DAG
How to reproduce
Create a simple sample dag with a schedule of * * * * * and pause with catchup=False and wait a few minutes, then run
airflow dags next-execution sample_dag
Operating System
Debian
Versions of Apache Airflow Providers
Airflow 2.2.2
Deployment
Astronomer
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created a year ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Command Line Interface and Environment Variables Reference
Get the next execution datetimes of a DAG. It returns one execution unless the num-executions option is given. airflow dags next-execution [-h] [-n ......
Read more >Rerun Airflow DAGs | Astronomer Documentation
In this guide, you'll learn how to rerun tasks or DAGs and trigger historical DAG runs, and review the Airflow concepts of catchup...
Read more >Airflow Documentation - Read the Docs
Use airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The airflow scheduler executes your tasks.
Read more >Release Notes - Apache Airflow documentation - Amazon AWS
This allows DAG runs to be automatically created as a result of a task “producing” a dataset. ... Add subdir parameter to dags...
Read more >Airflow CLI to pause, resume and stop an executing DAG
Miscellaneous commands airflow cheat-sheet | Display cheat sheet ... List DAG runs given a DAG id airflow dags next-execution | Get the next...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’d not add a short option for now. Short options are overrated and don’t need to exist anyway.
I guess the viable solution would be to add a flag to optionally respect catchup (and perhaps emit a warning when the command is run without the option but with
catchup=False, to tell the user to explicitly specify the behaviour).