You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Shally-Katariya (via GitHub)" <gi...@apache.org> on 2025/12/26 14:33:25 UTC
[PR] Don't poll HITL details when no pending dagrun on DAG page [airflow]
Shally-Katariya opened a new pull request, #59824:
URL: https://github.com/apache/airflow/pull/59824
Fixes #59760
This PR prevents polling the HITL details API on the DAG page when there are
no active or pending DAG runs, reducing unnecessary API calls and load.
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W merged PR #59824:
URL: https://github.com/apache/airflow/pull/59824
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3713423105
Awesome work, congrats on your first merged pull request! You are invited to check our [Issue Tracker](https://github.com/apache/airflow/issues) for additional contributions.
--
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] Don't poll HITL details when no pending dagrun on DAG page [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3692951557
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] Don't poll HITL details when no pending dagrun on DAG page [airflow]
Posted by "Shally-Katariya (via GitHub)" <gi...@apache.org>.
Shally-Katariya commented on code in PR #59824:
URL: https://github.com/apache/airflow/pull/59824#discussion_r2648421335
##########
airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx:
##########
@@ -105,7 +105,10 @@ export const Dag = () => {
);
const { tabs: processedTabs } = useRequiredActionTabs({ dagId }, tabs, {
- refetchInterval,
+ refetchInterval:
+ (dag?.active_runs_count ?? 0) > 0 || isStatePending(latestRun?.state)
Review Comment:
Thanks for pointing this out!
I’ve updated the condition to explicitly check that `latestRun` exists before calling `isStatePending`, as suggested.
This ensures polling only happens when there are active runs or when a latest run exists in a pending state.
Please let me know if this looks good now.
--
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] Don't poll HITL details when no pending dagrun on DAG page [airflow]
Posted by "Shally-Katariya (via GitHub)" <gi...@apache.org>.
Shally-Katariya commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3693105044
Thanks a lot for the review and kind words
Happy to wait for the UI code owner review.
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3710589963
hmm... let me try on my end and see whether I can fix it 🤔
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3709791033
Hey @Shally-Katariya , we're close to merging this one. But it would be nice if you could help us resolve the CI issue. Thanks!
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "Shally-Katariya (via GitHub)" <gi...@apache.org>.
Shally-Katariya commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3710553696
Thanks @Lee-W!
I ran both steps locally as suggested (and re-ran to double-check):
scripts/ci/prek/generate_openapi_spec.py (task-SDK / OpenAPI generation)
scripts/ci/prek/ts_compile_lint_ui.py (which runs pnpm tsc)
Both completed successfully, including the underlying pnpm tsc compile step, and did not produce any diffs — the working tree remains clean.
So it looks like the generated artifacts are already up to date locally.
Please let me know if you’d like me to try anything else or if this needs a CI-side rerun.
Thanks!
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3710417259
> Hi @Lee-W, I investigated the CI failure in detail.
>
> It looks like the static checks are failing due to a constraints diff (Python 3.10 – uv/keyrings versions). I tried regenerating constraints locally, but in this repo layout constraints generation is handled via CI scripts only (scripts/ci/constraints/*), not via Breeze or a local update script.
>
> Could you please regenerate the constraints from CI side? Happy to help further if needed. Thanks!
I think you'll need to run `prek generate-tasksdk-datamodels --all-files` locally
--
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] Don't poll HITL details when no pending dagrun on DAG page [airflow]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #59824:
URL: https://github.com/apache/airflow/pull/59824#discussion_r2648384433
##########
airflow-core/src/airflow/ui/src/pages/Dag/Dag.tsx:
##########
@@ -105,7 +105,10 @@ export const Dag = () => {
);
const { tabs: processedTabs } = useRequiredActionTabs({ dagId }, tabs, {
- refetchInterval,
+ refetchInterval:
+ (dag?.active_runs_count ?? 0) > 0 || isStatePending(latestRun?.state)
Review Comment:
The condition `isStatePending(latestRun?.state)` will return true when `latestRun` is undefined (no runs exist), because `isStatePending` returns true for undefined/null states. This contradicts the PR's intent to prevent polling when there are no active or pending DAG runs.
Consider explicitly checking if `latestRun` exists before calling `isStatePending`, for example:
`(dag?.active_runs_count ?? 0) > 0 || (latestRun && isStatePending(latestRun.state))`
This ensures that polling only occurs when there are actual active runs or when a latest run exists with a pending state.
```suggestion
(dag?.active_runs_count ?? 0) > 0 || (latestRun && isStatePending(latestRun.state))
```
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "Shally-Katariya (via GitHub)" <gi...@apache.org>.
Shally-Katariya commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3710105552
Hi @Lee-W, I investigated the CI failure in detail.
It looks like the static checks are failing due to a constraints diff
(Python 3.10 – uv/keyrings versions). I tried regenerating constraints
locally, but in this repo layout constraints generation is handled via
CI scripts only (scripts/ci/constraints/*), not via Breeze or a local
update script.
Could you please regenerate the constraints from CI side?
Happy to help further if needed.
Thanks!
--
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] Don't poll HITL details when no pending dagrun on Dag page [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #59824:
URL: https://github.com/apache/airflow/pull/59824#issuecomment-3713426611
### Backport successfully created: v3-1-test
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-1-test</td>
<td><a href="https://github.com/apache/airflow/pull/60150"><img src="https://img.shields.io/badge/PR-60150-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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