Repository navigation
fix(mappers): MapTags(drop_unmapped=True) predicts the system tags it keeps (ITL-1363) - #484
Conversation
… keeps (ITL-1363) MapTags' and MapData's schema predictions filtered the whole schema by the names of name_map, so with drop_unmapped the system-tag columns (named by no name_map, kept by the table) were missing under system_tags=True/all_info=True. One rule, mappers._plan_group, now decides renames and drops over the input's user columns only; MapTags, MapData and MapColumns use it. No row, column, hash or stored path changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared mapper schema planning src/orcapod/core/operators/mappers.py |
A shared helper plans renames and drops for listed columns. MapData, MapTags, and MapColumns use this planning logic. |
Prediction validation and issue records tests/test_core/operators/test_mapper_schema_prediction.py, tests/test_pipeline/test_zero_row_column_order.py, docs/dev/design_issues/ITL-1363-MT1.md, changelog.d/ITL-1363.md |
Tests compare predicted and computed schemas, check system tags and row fingerprints, and add mapper cases to zero-row column-order coverage. The design-issue document and changelog describe the change. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
- metamorphic-labs/orcapod-python#390: Adds the zero-row column-order sweep and changes
DropTagColumnsschema prediction to include retained system-tag columns.
Merge Risk: 
Minimal · up to 49964
-
Mapper schema prediction now matches the computed output by keeping system-tag columns when unmapped columns are dropped. The change is limited to schema prediction, and no row, hash, or stored-path changes are reported. No merge-blocking risk was found.
Security architecture risk: 
Minimal · up to 49964
-
The change aligns predicted schemas with existing mapper results. The inspected changes preserve reserved-column naming controls and introduce no demonstrated increase in privileges, data exposure, or persistent-state risk.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The demonstrated change affects schema descriptions consumed by downstream users of these in-process mapper operators. Preserving explicitly requested system-tag schema entries does not itself establish new access to row values or increased authority.
Trust Boundaries and Controls
- observed — Existing mapper constructors validate rename targets before storing the mapping. They reject meta names, system-tag and source-info prefixes, the reserved context name, and source-token separator ambiguity. The PR leaves these controls intact.
-
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the main change: MapTags with drop_unmapped=True now predicts the system-tag columns it keeps. The changeset matches this. The mappers.py changes, the new schema prediction tests, and the changelog all address this behavior. The title includes the ticket ID ITL-1363, which is acceptable.
-
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
- Mode: Review on demand
- Reviewed files: 5
- Charged: $1.25
- View usage details
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 Report✅ All modified and coverable lines are covered by tests.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Fixes ITL-1363
Problem
MapTags(drop_unmapped=True)predicted an output schema without the system-tag columns: itsunary_output_schemakept a tag only if it was a key ofname_map, and system tags never are. Underoutput_schema(columns={"system_tags": True})orall_info=Truethe prediction and the computed table disagreed.MapData's prediction filtered its data schema by the same rule (no column the data schema holds today was affected).Fix
One rule,
mappers._plan_group: only user columns (tags, non-meta data columns) are renamed or, withdrop_unmapped, dropped; system tags, source info, context and meta columns never are.MapTags' andMapData's predictions andMapColumns._planuse it. The table was already right; no row, column, hash, stored path or golden value changes (generate_golden_hashes.py --checkmatches).Checked across operators
Every exported operator's predicted column names were compared with
static_process(...).output_schema(...)under every column configuration (default, system_tags, source, meta, context, content_hash, all_info). Only the mappers had this defect. The Select/Drop column operators already derive their drop sets from the input's user columns.Tests
tests/test_core/operators/test_mapper_schema_prediction.py(57 tests):MapTags(with and withouttag_only),MapDataandMapColumns, with and withoutdrop_unmapped, a two-entryname_mapin both orders, over every arrangement of a 3-tag/3-data source (each tag order, table layout and tag role: plain, data-tags, mixed), for every column configuration. The prediction is compared withstatic_process(...).output_schema(...), and the async rows are checked against the sync rows and the predicted system tags. It also includes a columns-only check that every exported operator predicts the columns of its result. 9 of these tests fail on main.tests/test_pipeline/test_zero_row_column_order.py) gainsmap_tags_drop,map_data_drop,map_columnsandmap_columns_dropsteps. It had nodrop_unmappedstep before, which is why this bug slipped through. 16 of its cases fail on main.🤖 Generated with Claude Code
Summary by CodeRabbit