Skip to content

Keep simple values when global transform is false - #86

Merged
martinv13 merged 2 commits into
cre-dev:mainfrom
martinv13:fix-global-transform-simple-values
Oct 20, 2026
Merged

martinv13 merged 2 commits into
cre-dev:mainfrom
martinv13:fix-global-transform-simple-values

Conversation

@martinv13

Copy link
Copy Markdown
Collaborator

Closes #81.

Fix

With the global "transform": false option, simple element values were silently loaded as NULL. The parser uses the "join" field transform to know which fields hold simple values, and _get_field_transform turned it off along with elevation when the global option was false. Simple columns now always get "join", so the global option only disables elevation of child tables and collapsing of choice groups. Per-field transform: false is unchanged.

The docs entry for the global option said it also disabled joining of multi-value columns. It now says joining stays on, which matches the existing note that opting out of join is not supported.

Tests

  • New orders sample model version (version3) with global "transform": false, picked up by the existing parametrized tests. Without the fix, it fails the XML round-trip and the document-tree-to-XML tests. It skips extra: without elevation, the empty <extra> element in equivalent_xml would add a row.

Unrelated to the bug, some other config options had no test coverage, so the second commit adds:

  • A forced "elevate" on shipto (optional, many columns, so never elevated automatically) and a field type override (quantity: BigInteger) in version2.
  • choice_transform: True on companyId in version3, overriding the global transform: false.
  • test_document_tree_hooks, running both hooks during parsing with each parsing strategy.

Snapshots were regenerated: version2 changes and the version3 files are new. The full suite passes on DuckDB and mkdocs build --strict passes.

🤖 Generated with Claude Code

martinv13 and others added 2 commits October 20, 2026 22:39
With the global "transform": false option, simple columns lost their
"join" transform, which the parser uses to read simple element values,
so these values were loaded as NULL. The global option now only disables
elevation and choice collapsing.

Add an orders sample model version with global "transform": false so
that round-trip tests cover it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Extend the orders sample model configs with a forced "elevate" on an
optional child, a column type override, and choice_transform: True
overriding the global transform: false. Add a test running
document_tree_hook and document_tree_node_hook during parsing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@martinv13
martinv13 merged commit 9e9d318 into cre-dev:main Oct 20, 2026
10 checks passed
@martinv13
martinv13 deleted the fix-global-transform-simple-values branch October 20, 2026 20:45
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.

Global transform: false loads simple values as NULL

1 participant