Skip to content

Use set for llm_completed and remove dead pending branch in TUI#64585

Merged
potiuk merged 1 commit intoapache:mainfrom
andreahlert:fix/llm-completed-set-and-dead-code
Apr 1, 2026
Merged

Use set for llm_completed and remove dead pending branch in TUI#64585
potiuk merged 1 commit intoapache:mainfrom
andreahlert:fix/llm-completed-set-and-dead-code

Conversation

@andreahlert
Copy link
Copy Markdown
Contributor

Summary

Why

llm_completed is checked on every poll cycle to filter out already-collected futures, and as a list that check is O(n) per future which gets noticeable with larger batches.

llm_completed is used to track which LLM futures have already been collected. It was a list, so the f not in llm_completed check in _collect_llm_results was O(n) on every poll cycle,. With many PRs this adds up. Switched to a set for O(1) lookup. No behavior change since the container is never iterated, indexed, or ordered.

Also removed a duplicate elif entry.llm_status == "pending" branch in the TUI PR table builder that was shadowed by an earlier branch in the same chain and could never execute.

Test plan

  • All existing tests pass (75 TUI + 39 LLM = 114 tests)
  • breeze pr auto-triage --tui works as before

Was generative AI tooling used to co-author this PR?
  • No

Switch llm_completed from list to set so the membership check in
_collect_llm_results runs in O(1) instead of O(n) per poll cycle.
Remove unreachable duplicate elif for llm_status == "pending" in
the TUI PR table builder.

Signed-off-by: André Ahlert <andre@aex.partners>
@potiuk potiuk merged commit 6bd6fdf into apache:main Apr 1, 2026
144 of 147 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Backport failed to create: v3-2-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 6bd6fdf v3-2-test

This should apply the commit to the v3-2-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Apr 3, 2026
…he#64585)

Switch llm_completed from list to set so the membership check in
_collect_llm_results runs in O(1) instead of O(n) per poll cycle.
Remove unreachable duplicate elif for llm_status == "pending" in
the TUI PR table builder.

Signed-off-by: André Ahlert <andre@aex.partners>
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
…he#64585)

Switch llm_completed from list to set so the membership check in
_collect_llm_results runs in O(1) instead of O(n) per poll cycle.
Remove unreachable duplicate elif for llm_status == "pending" in
the TUI PR table builder.

Signed-off-by: André Ahlert <andre@aex.partners>
@andreahlert andreahlert deleted the fix/llm-completed-set-and-dead-code branch April 11, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants