Skip to content

Non-ASCII text in Result.to_json(): raw UTF-8 on the JVM wheel, escaped on the native wheel #454

Open

Description

@tae898

A non-ASCII string in Result.to_json() is raw UTF-8 on the JVM wheel and written with \u escapes on the native wheel, as the probe behind #446 showed (I noted it in the status comment on #314, item 5, and it is not in the golden test yet). Both texts are valid JSON and parse to the same string, so the values are equal. What differs is the text: its length and its bytes, which matters to anything that hashes, diffs, or measures the text of to_json().

I have not measured how much longer the escaped text is for a table that is mostly non-ASCII.

What I would do: write raw UTF-8 on both wheels (shorter and readable, and the JVM wheel already does), which changes the native writer, and pin it in tests/test_cross_wheel_golden.py with a string that has a two-byte and a four-byte character. If the native writer cannot do that cheaply, the fallback is one sentence in the docs that the text of to_json() is not byte-equal between wheels and that the parsed values are.

Refs #314 (item 5 of the status comment of 2026-11-22). Items 2 and 4 of that comment (the float text and the last digits of vector distances) are about float32 rounding and stay in #314 as documentation points.

Activity

  1. added this to the 27.1.1 milestone on Nov 22, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. added
    bug
    python
    native
    on Nov 22, 2026
  4. added
    jvm
    vector
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugjvmnativepythonvector

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions