airflow: CLI command "airflow dags next-execution" give unexpected results with paused DAG and catchup=False

Apache 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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

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).

@boushphong please go ahead