[PR #283] [MERGED] Fix collect_events returning None instead of empty list for empty expected list #286

Closed
opened 2026-02-16 02:17:08 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/283
Author: @adrianlyjak
Created: 1/15/2026
Status: Merged
Merged: 1/15/2026
Merged by: @adrianlyjak

Base: mainHead: adrian/fix-empty-collect-events


📝 Commits (2)

📊 Changes

4 files changed (+31 additions, -2 deletions)

View changed files

.changeset/fine-places-pump.md (+5 -0)
📝 packages/llama-index-workflows/src/workflows/runtime/broker.py (+4 -0)
📝 packages/llama-index-workflows/tests/context/test_context.py (+20 -0)
📝 uv.lock (+2 -2)

📄 Description

  • Fix edge case where collect_events returns None instead of [] when passed an empty expected list
  • Add test to verify the correct behavior

When calling ctx.collect_events(ev, []) with an empty expected list, the method incorrectly returned None instead of an empty list []. This can frequently lead to waiting forever, since the expectation is that None means not finished

Added an early return check: if the expected list is empty, return [] immediately since there are no events to collect.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/283 **Author:** [@adrianlyjak](https://github.com/adrianlyjak) **Created:** 1/15/2026 **Status:** ✅ Merged **Merged:** 1/15/2026 **Merged by:** [@adrianlyjak](https://github.com/adrianlyjak) **Base:** `main` ← **Head:** `adrian/fix-empty-collect-events` --- ### 📝 Commits (2) - [`d566ec8`](https://github.com/run-llama/workflows-py/commit/d566ec87d25b9dafa84fe9b7d2dc3e09fcf2fbdb) Handle empty collect_events - [`fab6b65`](https://github.com/run-llama/workflows-py/commit/fab6b659744db53daef31b2f4b0cafee383d47d4) Add changeset ### 📊 Changes **4 files changed** (+31 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/fine-places-pump.md` (+5 -0) 📝 `packages/llama-index-workflows/src/workflows/runtime/broker.py` (+4 -0) 📝 `packages/llama-index-workflows/tests/context/test_context.py` (+20 -0) 📝 `uv.lock` (+2 -2) </details> ### 📄 Description - Fix edge case where collect_events returns None instead of [] when passed an empty expected list - Add test to verify the correct behavior When calling `ctx.collect_events(ev, [])` with an empty expected list, the method incorrectly returned None instead of an empty list []. This can frequently lead to waiting forever, since the expectation is that `None` means not finished Added an early return check: if the expected list is empty, return [] immediately since there are no events to collect. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:17:08 -05:00
yindo closed this issue 2026-02-16 02:17:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#286