Skip to content

test(hashing): keep wrapped Batch input cold on Python 3.11 - #664

Merged
eywalker merged 1 commit into
mainfrom
eywalker/itl-1559-fix-identity-chain-test-python-311
Nov 29, 2026
Merged

eywalker merged 1 commit into
mainfrom
eywalker/itl-1559-fix-identity-chain-test-python-311

Conversation

@eywalker

@eywalker eywalker commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

ITL-1559

The wrapped Batch regression test checked isinstance(result, StreamProtocol) before installing its row-build guard. CPython 3.11 uses hasattr for runtime protocol checks, so this assertion evaluates arrow_types_declared, and zero-row schema inference materializes the lazy input. CPython 3.12 and 3.13 use static lookup and leave the input cold. The test now constructs the Batch under the guard and omits the redundant protocol assertion. Python typing documentation

Both combined hash accessors correctly refuse to materialize a cold wrapper on all three versions. No digest differed across Python 3.11, 3.12, and 3.13 for inputs in the same state. I compared the pipeline, node, legacy content, and chain content hashes for a source, a wrapped source, a direct Batch, a Join, and a Batch over both cold and warm wrappers. The original test accidentally exercised the warm case on 3.11, where the two combined digests match the warm results on 3.12 and 3.13.

PR #652 at 250a8db2 reproduced the original failure on 3.11. This patch applies cleanly and the test passes on that head.

This is a test-only correction. No changelog fragment is needed. The changelog validator and its tests allow this.

Verification

  • Targeted identity and changelog tests on Python 3.11, 3.12, and 3.13
  • Golden hash --check on all three versions
  • Ruff lint and format checks and basedpyright

Summary by CodeRabbit

  • Tests
    • Updated a test to avoid triggering lazy row materialization while checking wrapped batch identity.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test now constructs Batch(2)(wrapped) while _rows_to_table is patched to fail. It removes the StreamProtocol assertion and notes that runtime protocol checks may materialize rows on Python 3.11.

Changes: Lazy batch test

Layer / File(s) Summary
Batch construction check
tests/test_hashing/test_identity_chains.py
The test constructs the batch inside the _rows_to_table failure guard. It removes the StreamProtocol assertion and adds a comment about possible row materialization during Python 3.11 runtime protocol checks.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to c739a

This test-only change keeps the lazy Batch identity test from materializing its input on Python 3.11. It does not change production behavior, and no merge-blocking risk is identified.

Security architecture risk: Minimal · up to c739a

The patch corrects how a test keeps its input lazy. It does not change production behavior or exposure.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(hashing): keep wrapped Batch input cold on Python 3.11" matches the change. The PR modifies the hashing regression test so the wrapped Batch stays unmaterialized on Python 3.11 by cons…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test(hashing): keep wrapped Batch input cold on Python 3.11" matches the change. The PR modifies the hashing regression test so the wrapped Batch stays unmaterialized on Python 3.11 by constructing the Batch while _rows_to_table is patched to fail, and removes the StreamProtocol assertion that triggered materialization. The title is specific, concise, and conveys the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 08c048a and c739a4e.

Files selected for processing: 1

  • tests/test_hashing/test_identity_chains.py

Limit details: You’ve used the included review currently available. Your 99 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

Code guidelines: 1

CLAUDE.md — auto-discovered
Path-based instructions: 1

Source excerpt: Use [Google style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) Python docstrings everywhere.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • tests/test_hashing/test_identity_chains.py

@eywalker
eywalker merged commit 1fb2a7f into main Nov 29, 2026
10 checks passed
@eywalker
eywalker deleted the eywalker/itl-1559-fix-identity-chain-test-python-311 branch November 29, 2026 03:19
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