Skip to content

native: a query row nested in a value reaches Python as a map, not a str (#195) - #196

Merged
tae898 merged 3 commits into
mainfrom
fix/195-nested-result-codec
Nov 2, 2026
Merged

tae898 merged 3 commits into
mainfrom
fix/195-nested-result-codec

Conversation

@tae898

@tae898 tae898 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #195

NativeCodec.append had no branch for a Result, so a query row nested in a value (an entry of schema:types.properties, for example) fell through to String.valueOf and reached Python as a str. It is now written as its element when it has one (the way a Document value is written), else as a map of its properties through the existing Map branch, which keeps the tag-collision handling.

Test: tests/test_schema_nested_rows.py creates a type with two properties, reads SELECT properties FROM schema:types, and checks on both builds that every entry is a map with the right name and type; on the native build it also checks that the entries are plain dicts. Found by the native examples job of #192 (PR #193): examples 04, 05 and 06 failed on the native package only, and #193 will run them once this is in.

The bindings had worked around the str: DataFrame ingest (dataframe._declared_types_native) and NativeType.getPropertyNames parsed each entry with a regex over the engine's text form of the row. They now read name and type from the map, with the regex kept as a fallback for the old form; without that change 16 tests of test_dataframe_ingest.py failed on this PR's first push.

🤖 Generated with Claude Code

tae898 and others added 3 commits November 2, 2026 20:20
…str (#195)

NativeCodec.append had no branch for a Result, so an entry of schema:types.properties
(and any Result nested in a value) fell through to String.valueOf. It is now written as
its element when it has one, else as a map of its properties through the Map branch
(which keeps the tag-collision handling). Found by the native examples job (#192):
examples 04, 05 and 06 failed on the native package only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DataFrame ingest (dataframe._declared_types_native) and NativeType.getPropertyNames parsed
each entry of schema:types.properties with a regex over the engine's text form of the row,
the workaround for the str the codec used to write. With the codec now writing a map they
read name and type directly; the regex stays as a fallback for the old text form. This is
what failed 16 tests of test_dataframe_ingest.py on the first push of this PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
columnar._declared_types was the third copy of the regex over the engine's text form of a
schema:types property entry (after dataframe.py and schema_objects.py); with the codec
writing maps it raised TypeError in 29 parity tests (column inserts, float-vector bulk,
point reads, result transport). It now uses schema_objects._name_type, so the reader
exists twice (dataframe.py keeps its own copy to stay off _native on the JVM build).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tae898
tae898 merged commit 7d59474 into main Nov 2, 2026
36 checks passed
@tae898
tae898 deleted the fix/195-nested-result-codec branch November 2, 2026 12:34
tae898 added a commit that referenced this pull request Nov 2, 2026
…6.11.1 one (#192)

From the first runs of the job (all four platforms, Python 3.12 and 3.14, the same nine
failures everywhere): 02, 03 and 25 use jpype directly, 14 starts the JVM itself, 15 reads
Java Schema objects (NotOnNativeYet), 29 needs the vectorNeighbors where option of engine
26.11.1 while the CI native image links 26.10.2. Examples 04, 05 and 06 are not listed:
they failed on a bug (#195), fixed by PR #196, which this branch is rebased on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tae898 added a commit that referenced this pull request Nov 2, 2026
* ci: run examples/ against the installed native wheel (#192)

New job "Examples on the installed wheel" in test-native.yml: the four platforms, Python 3.12 and 3.14 (a pull request: linux-x86_64, 3.12), the wheel the build job already uploads, installed with uv. The per-example arguments, timeouts, dataset handling and the answer check of example 10 move out of test-python-examples.yml into scripts/run_examples.sh, which both workflows call, so the JVM job behaves as before. scripts/native_examples_skip.txt lists, with a reason, the examples that need the JVM package (empty to start); the runner prints it. examples-summary is the one check for all legs. The native workflow also runs when examples/ or the runner change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: native examples skip list: the JVM-only examples and the engine-26.11.1 one (#192)

From the first runs of the job (all four platforms, Python 3.12 and 3.14, the same nine
failures everywhere): 02, 03 and 25 use jpype directly, 14 starts the JVM itself, 15 reads
Java Schema objects (NotOnNativeYet), 29 needs the vectorNeighbors where option of engine
26.11.1 while the CI native image links 26.10.2. Examples 04, 05 and 06 are not listed:
they failed on a bug (#195), fixed by PR #196, which this branch is rebased on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

native: SELECT properties FROM schema:types returns each property as a str, not a map as on the JVM build

1 participant