Skip to content

Verify read_values() iterator support and confirm documentation accuracy#1557

Closed
Copilot wants to merge 1 commit intocleanup-read-recordsfrom
copilot/sub-pr-1556
Closed

Verify read_values() iterator support and confirm documentation accuracy#1557
Copilot wants to merge 1 commit intocleanup-read-recordsfrom
copilot/sub-pr-1556

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Addressed review feedback questioning whether read_values() actually supports iterators as claimed by a bot reviewer.

Analysis

Verified that read_values() does not support iterators:

  • values_to_tuples() explicitly requires Sequence types via isinstance(v, Sequence) check (line 173)
  • Sequence types (lists, tuples) must be materialized in memory, unlike Iterable
  • This is fundamentally different from read_records() which accepts Iterable[dict] for lazy processing

Outcome

Existing documentation is correct and requires no changes. The statement that read_values() "cannot handle large datasets efficiently since it needs to load all data into memory" accurately reflects the implementation.

# read_values() requires sequences (materialized in memory)
dc.read_values(data=[1, 2, 3, 4, 5])  # ✓ Works
dc.read_values(data=(x for x in range(5)))  # ✗ Fails - not a Sequence

# read_records() supports iterators (lazy processing)
dc.read_records(({"x": i} for i in range(1000000)), schema={"x": int})  # ✓ Works

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update read_records API and clean up documentation Verify read_values() iterator support and confirm documentation accuracy Jan 15, 2026
Copilot AI requested a review from shcheklein January 15, 2026 21:57
@shcheklein shcheklein closed this Jan 15, 2026
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.

2 participants