Skip to content

fix(join): reject mismatched logical type identifiers - #508

Merged
eywalker merged 1 commit into
mainfrom
eywalker/itl-1380-join-accepts-a-shared-key-of-a-users
Nov 23, 2026
Merged

eywalker merged 1 commit into
mainfrom
eywalker/itl-1380-join-accepts-a-shared-key-of-a-users

Conversation

@eywalker

@eywalker eywalker commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes ITL-1380

PyArrow can consider two instances of the same Python extension type class equal even when they serialize different parameters. Joins could then match keys with different logical types, and MergeJoin could pass incompatible colliding data columns into aggregation.

Shared-type checking now requires both Arrow equality after large normalization and identical logical type identifiers throughout the type tree. Validation errors identify the column and include the full identifiers from each input.

Caller Behavior
core/operators/base.require_shared_arrow_type Raises InputValidationError for identifier mismatches and shows both input types with their logical identifiers.
Join Rejects mismatches on shared tag keys for two or more inputs, on sync and async paths.
MergeJoin Rejects mismatches on shared tag keys and colliding data columns before matching or aggregation, on sync and async paths. The same rule covers shared source-info columns.
SemiJoin Rejects mismatches on shared tag keys on sync and async paths. Its match-key selection is unchanged.
Rejoin Rejects mismatches in the shared columns it compares when pairing rows, on sync and async paths.
core/nodes/function_node._concat_row_tables Rejects mismatches when rebuilding tables from row-backed results and reports both identifiers.

The regression tests exercise both input orders, two- and three-input joins, and top-level and nested extension types. The frozen golden values match.

Generated with Codex on behalf of the developer

Summary by CodeRabbit

  • Bug Fixes
    • Joins now reject shared keys and colliding columns with incompatible Arrow extension types, including mismatches nested within lists, structs, or maps.
    • Compatible extension types continue to join, including built-in path types.
  • Improvements
    • Type mismatch errors now identify the affected column and show the conflicting logical types, making join failures easier to diagnose.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4d192bf and 7a4011a.

Files selected for processing: 7

  • changelog.d/ITL-1380.md
  • docs/dev/design_issues/ITL-1380-JE1.md
  • src/orcapod/core/nodes/function_node.py
  • src/orcapod/core/operators/base.py
  • src/orcapod/utils/arrow_utils.py
  • tests/test_core/operators/several_items.py
  • tests/test_core/operators/test_join_logical_types.py

Limit details: You’ve used the included review currently available. Your 100 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: 6

Source excerpt: Provisional operators are outside the freeze (developer, November 18, 2026, ITL-1266): `orcapod.operators.PROVISIONAL_OPERATORS` (`core/operators/provisional.py`) is the one list (name to the issue deciding its identity), an...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • src/orcapod/core/operators/base.py
Source excerpt: `docs/dev/design_issues/` is the canonical log of known design problems, bugs, and code quality issues: one file per entry (developer, November 11, 2026; ITL-968).

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/dev/design_issues/ITL-1380-JE1.md
Source excerpt: A pull request never edits `CHANGELOG.md` (developer, November 11, 2026; ITL-961).

CodeRabbit inference engine (CLAUDE.md)

Files:

  • changelog.d/ITL-1380.md
Source excerpt: An entry is the file `docs/dev/design_issues/-.md` (e.g.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • docs/dev/design_issues/ITL-1380-JE1.md
Source excerpt: The file holds only the text that would have gone under the release heading in `CHANGELOG.md`: the same category headings `CHANGELOG.md` uses (`### Breaking changes and migration`, `### Added`, `### Changed`, `### Fixed`, `#...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • changelog.d/ITL-1380.md
Source excerpt: Documents written during development are kept in the repository, under `docs/dev/` (developer, November 16, 2026; ITL-1169): Never put them in the published documentation (`docs/` outside `docs/dev/`) or at the top level of...

CodeRabbit inference engine (CLAUDE.md)

Files:

  • changelog.d/ITL-1380.md
  • docs/dev/design_issues/ITL-1380-JE1.md
  • src/orcapod/core/nodes/function_node.py
  • src/orcapod/core/operators/base.py
  • src/orcapod/utils/arrow_utils.py
  • tests/test_core/operators/several_items.py
  • tests/test_core/operators/test_join_logical_types.py
Learnings: 2

Common learnings

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-22T11:16:25.217Z
Learning: Source excerpt:
# Claude Code instructions for orcapod-python

## Architecture overview

### Arrow types

Respect the Arrow types the inputs already have, normalized to their large variants (developer,
November 10, 2026: large and non-large variants hash identically, so always normalize to large
for consistency). Infer an Arrow type from Python values only when no Arrow type is known, and
then through the data context's type converter — never call `pa.array(values)` /
`pa.Table.from_pylist(rows)` without a type for a column whose input type is known, because
inference widens `int8` to `int64`, `float32` to `double`, and takes decimal precision from the
data. The rules:

- **Type strictness** (developer, November 10, 2026): Orcapod is type strict. It never
  expands or converts a type implicitly; the only exception is normalization to large variants.
  Inputs that disagree on a column's type are an error naming the column and both types, on
  every execution path (sync and async).
  Fun...
Learning: 2026-11-20T22:22:42.419Z

Learnt from: CR
Repo: metamorphic-labs/orcapod-python PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-11-20T22:22:42.419Z
Learning: Applies to changelog.d/*.md : Source excerpt:
# Claude Code instructions for orcapod-python

## Changelog

- The file holds only the text that would have gone under the release heading in
  `CHANGELOG.md`: the same category headings `CHANGELOG.md` uses
  (`### Breaking changes and migration`, `### Added`, `### Changed`, `### Fixed`,
  `### Known limitations`), each followed by its text: bullet lines, or `####` sub-headings
  with paragraphs, as `CHANGELOG.md` itself has. No version heading, no date, no other
  `#`, `##` or `###` heading, and no empty category.

Applied to files:

  • changelog.d/ITL-1380.md
Additional comments: 7

src/orcapod/utils/arrow_utils.py: 1

6-6: LGTM!

Also applies to: 15-15, 323-350, 364-366, 382-386

src/orcapod/core/nodes/function_node.py: 1

244-248: LGTM!

src/orcapod/core/operators/base.py: 1

58-59: LGTM!

Also applies to: 62-62

changelog.d/ITL-1380.md: 1

1-5: LGTM!

docs/dev/design_issues/ITL-1380-JE1.md: 1

1-15: LGTM!

tests/test_core/operators/several_items.py: 1

196-196: LGTM!

Also applies to: 213-227

tests/test_core/operators/test_join_logical_types.py: 1

1-277: LGTM!

Walkthrough

Join type validation now checks extension identifiers in addition to normalized Arrow types. Conflict messages show both formatted types. Tests cover nested extension types and built-in Path keys across join operators and execution modes.

Changes: Join type checks

Layer / File(s) Summary
Type comparison and conflict details
src/orcapod/utils/arrow_utils.py, src/orcapod/core/nodes/function_node.py, src/orcapod/core/operators/base.py, changelog.d/ITL-1380.md, docs/dev/design_issues/ITL-1380-JE1.md
shared_arrow_type now checks ordered extension identifiers after normalization. Conflict messages show formatted Arrow types. The changelog and design issue document the checks.
Join compatibility tests
tests/test_core/operators/several_items.py, tests/test_core/operators/test_join_logical_types.py
Tests cover matching and mismatched identifiers across join operators, nested types, execution modes, and input order. Additional tests check joins on built-in Path keys.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 7a401

Joins and row-table reconstruction now reject columns whose extension types differ in serialized parameters, and the error shows both types. No merge-blocking risk was found.

Security architecture risk: Minimal · up to 7a401

The change prevents incompatible logical types from being combined. It does not add an access path or change how data is stored or deployed. Validation errors include more type detail, but no new disclosure across an access boundary was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The flagged table constructors build test inputs, and the flagged extension serializer belongs to a test type installed through a pytest fixture. These declarations do not expose a production parser or endpoint.

Trust Boundaries and Controls

  • observed — The changed validation messages include both extension names and full metadata bytes in reversible hex. The inspected paths raise an exception to the caller; whether a downstream application forwards that detail to logs or clients was not established.

Hardening Proposals

  • proposed — If an embedding application forwards validation errors to a less-trusted audience, keep the column name and mismatch reason but omit raw extension metadata from that response.
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 "fix(join): reject mismatched logical type identifiers" matches the main change. The changeset makes shared Arrow extension types require matching logical type identifiers in joins, MergeJoi…
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 "fix(join): reject mismatched logical type identifiers" matches the main change. The changeset makes shared Arrow extension types require matching logical type identifiers in joins, MergeJoin, SemiJoin, and row-table reconstruction (function_node._concat_row_tables). The title names the fix, the affected area (join), and the core behavior. It is concise and uses a conventional commit format.

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.

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/orcapod/utils/arrow_utils.py 93.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/orcapod/core/nodes/function_node.py 95.07% <100.00%> (ø)
src/orcapod/core/operators/base.py 93.33% <100.00%> (+0.11%) ⬆️
src/orcapod/utils/arrow_utils.py 90.59% <93.33%> (+0.03%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eywalker
eywalker merged commit 2d64d32 into main Nov 23, 2026
16 checks passed
@eywalker
eywalker deleted the eywalker/itl-1380-join-accepts-a-shared-key-of-a-users branch November 23, 2026 05:06
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