You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bramhanandlingala (via GitHub)" <gi...@apache.org> on 2026/05/24 17:24:04 UTC

[PR] Fix: dag next-execution --table crashes when no next run exists (#67394) [airflow]

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: dag next-execution --table crashes when no next run exists (#67394) [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #67425:
URL: https://github.com/apache/airflow/pull/67425#issuecomment-4529466857

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our [Contributors' Guide](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: dag next-execution --table crashes when no next run exists (#67394) [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #67425:
URL: https://github.com/apache/airflow/pull/67425#issuecomment-4798343244

   @bramhanandlingala — I've removed the `ready for maintainer review` label because the next step here is yours: this branch now has **merge conflicts with `main`**. It'll go back into the maintainer queue automatically once you rebase onto the latest `main` and push — no need to re-add the label by hand. There's no rush.
   
   <sub>Automated triage note drafted by an AI-assisted tool — may get things wrong; a real Apache Airflow maintainer takes the next look once it's green. ([why automated](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md))</sub>
   
   ---
   Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: dag next-execution --table crashes when no next run exists (#67394) [airflow]

Posted by "bramhanandlingala (via GitHub)" <gi...@apache.org>.
bramhanandlingala commented on PR #67425:
URL: https://github.com/apache/airflow/pull/67425#issuecomment-4532377772

   @ashb @XD-DENG @bolkedebruin @jedcunningham @ephraimbuddy
   Could you please review this PR? It touches DAG-related code.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix: dag next-execution --table crashes when no next run exists (#67394) [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #67425:
URL: https://github.com/apache/airflow/pull/67425#issuecomment-5021933636

   @bramhanandlingala This PR has been converted to **draft** because it does not yet meet our [Pull Request quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
   
   **Issues found:**
   - :x: **Merge conflicts**: This PR has merge conflicts with `main` and cannot be merged as-is. Rebase locally and resolve them: `git fetch upstream main && git rebase upstream/main`, resolve the conflicts, then force-push.
   
   > **Note:** Your branch is **1281 commits behind `main`**. Some check failures may be caused by changes in the base branch rather than by your PR. Please rebase your branch and push again to get up-to-date CI results.
   
   **What to do next:**
   - Fix each issue listed above.
   - Make sure static checks pass locally (`prek run --from-ref main --stage pre-commit`).
   - Mark the PR as "Ready for review" when you're done.
   
   Converting a PR to draft is **not** a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the [Airflow Slack](https://s.apache.org/airflow-slack).
   
   ---
   
   _Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this [two-stage triage process](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md#why-the-first-pass-is-automated) so that our maintainers' limited time is spent where it matters most: the conversation with you._


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org