mik-laj commented on a change in pull request #9072:
URL: https://github.com/apache/airflow/pull/9072#discussion_r432854430
##########
File path: airflow/cli/commands/dag_command.py
##########
@@ -277,15 +277,24 @@ def dag_next_execution(args):
if dag.get_is_paused():
print("[INFO] Please be reminded this DAG is PAUSED now.")
+ if args.num_executions <= 0:
+ print(None)
+ return
+
latest_execution_date = dag.get_latest_execution_date()
if latest_execution_date:
next_execution_dttm = dag.following_schedule(latest_execution_date)
if next_execution_dttm is None:
print("[WARN] No following schedule can be found. " +
"This DAG may have schedule interval '@once' or `None`.")
Review comment:
```suggestion
"This DAG may have schedule interval '@once' or `None`.",
file=sys.stderr)
```
##########
File path: airflow/cli/commands/dag_command.py
##########
@@ -277,15 +277,24 @@ def dag_next_execution(args):
if dag.get_is_paused():
print("[INFO] Please be reminded this DAG is PAUSED now.")
+ if args.num_executions <= 0:
+ print(None)
+ return
+
latest_execution_date = dag.get_latest_execution_date()
if latest_execution_date:
next_execution_dttm = dag.following_schedule(latest_execution_date)
if next_execution_dttm is None:
print("[WARN] No following schedule can be found. " +
"This DAG may have schedule interval '@once' or `None`.")
+ print(None)
+ else:
+ print(next_execution_dttm)
- print(next_execution_dttm)
+ for _ in range(1, args.num_executions):
+ next_execution_dttm =
dag.following_schedule(next_execution_dttm)
+ print(next_execution_dttm)
else:
print("[WARN] Only applicable when there is execution record found for
the DAG.")
Review comment:
```suggestion
print("[WARN] Only applicable when there is execution record found
for the DAG.", file=sys.stderr)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]