bramhanandlingala opened a new pull request, #67425: URL: https://github.com/apache/airflow/pull/67425
When you run `airflow dags next-execution <dag_id> --table`, it crashes with an `AttributeError` if the DAG has no upcoming scheduled run. For example when `schedule=None`, or when a `@once` DAG has already run and you ask for a second execution with `--num-executions 2`. The bug is in the `--table` branch of `dag_next_execution`. It used a one-liner list comprehension that called `operator.attrgetter` on every item yielded by `iter_next_dagrun_info()`. The problem is that iterator can yield `None` to signal "no more runs", and calling an attribute getter on `None` blows up immediately. The non-table code path right below it already handles this correctly. it checks `if info is None`, prints a warning to stderr, and carries on. The table branch just never got the same treatment. This PR fixes it by expanding the list comprehension into a proper loop, adding the same `None` check, and emitting the same warning message. Valid runs are collected into a list and printed as a table as before; `None` entries are skipped with a warning. Are you willing to submit PR? Yes, if helpful. Code of Conduct I agree to follow this project's Code of Conduct closes: #67394 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
