Skip to content

added ability to set a single value instead of relying on a list of v…#261

Merged
bradley-erickson merged 4 commits intomasterfrom
berickson/20260130-execution-dag-single-value
Feb 3, 2026
Merged

added ability to set a single value instead of relying on a list of v…#261
bradley-erickson merged 4 commits intomasterfrom
berickson/20260130-execution-dag-single-value

Conversation

@bradley-erickson
Copy link
Collaborator

…alues

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e872aebfaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 524 to 528
if isinstance(values, (str, bytes)):
return [values]
if isinstance(values, collections.abc.Iterable):
return values
return [values]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Implement broadcast for single scope values

The new single-value support wraps scalars into a one‑element list, but _extract_fields_with_provenance zips all scope iterables and stops at the shortest. That means a call like scope_fields={"student": "bob", "doc_id": [..many..]} will yield only one key instead of applying student across all doc_ids, contradicting the documentation and silently truncating results whenever any other scope axis has more than one value. Consider broadcasting single values to match the longest iterable instead of returning a length‑1 list.

Useful? React with 👍 / 👎.

@bradley-erickson
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7a530a527

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 591 to 592
iterables = [_expand_scope_values(values, repeat=True) for _, values, _ in scope_specs]
async for items in _async_zip_many(iterables):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard against infinite zip when all scopes are singletons

When multiple scope fields are provided as single values, each value is wrapped as _ScopeSingleton and then expanded with repeat=True, which returns the infinite _repeat_value generator for every field. _async_zip_many only stops when any generator is exhausted, so with all-infinite generators it never terminates, causing handle_keys to hang instead of yielding a single key. This happens for inputs like student='s1' and doc_id='d1' in the multi-scope path; consider detecting the “all singletons” case and emitting one tuple.

Useful? React with 👍 / 👎.

Comment on lines 522 to 528
def _normalize_scope_values(values):
if values is None:
return _ScopeSingleton(None)
if isinstance(values, collections.abc.AsyncIterable):
return values
if isinstance(values, dict):
return values

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat dict singletons as repeatable values in multi-scope

_normalize_scope_values returns dicts unchanged, and _expand_scope_values only repeats _ScopeSingleton values. In a multi-scope query, passing a single dict as a value (common when a scope item is a dict) will produce a generator that yields once and then stops, so _async_zip_many will truncate to a single combination instead of repeating that dict across the other scope values. This makes the new “single value applied across all items” behavior inconsistent for dict inputs.

Useful? React with 👍 / 👎.

@bradley-erickson bradley-erickson force-pushed the berickson/20260130-execution-dag-single-value branch from 203e245 to 1310c89 Compare February 3, 2026 14:08
@bradley-erickson
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1310c89e69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 767 to 769
# Multiple dimensions: zip with broadcasting for single values
iterables = [_expand_scope_value(values, broadcast=True) for _, values, _ in scope_specs]
async for items in _async_zip_many(iterables):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop infinite scope tuple generation when all fields are single values

When there are multiple scope dimensions, single values are expanded with broadcast=True, which uses _repeat_forever and makes each dimension an infinite async iterator. If every scope field is a single value (e.g., scope_fields={"student": "bob", "doc_id": "doc1"} or STUDENTS="bob" + RESOURCES="doc1"), _async_zip_many never hits StopAsyncIteration, so _extract_fields_with_provenance yields tuples forever and the query will hang. This is a regression introduced by the new SingleValue broadcasting; the multi-dimension case needs a finite termination condition when all dimensions are singletons.

Useful? React with 👍 / 👎.

@bradley-erickson
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bradley-erickson bradley-erickson merged commit 5f75e49 into master Feb 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant