Skip to content

JVM wheel: to_json_list() returns an int for a DECIMAL of scale 0, the native wheel a float #452

Closed

Description

@tae898

The two wheels return different Python types for an integral DECIMAL in to_json_list(). The JVM wheel returns an int when the scale is 0 (Decimal("3") gives 3), the native wheel returns a float (3.0). For Decimal("2.00") both return the float 2.0. The docstring of to_json_list() says a DECIMAL arrives as a float.

For a large integral value the numbers themselves differ, not only the type:

Value arcadedb-jvm arcadedb (native)
Decimal("3") int 3 float 3.0
Decimal("-7") int -7 float -7.0
Decimal("2.00") float 2.0 float 2.0
Decimal("12345678901234567890") int 12345678901234567890 float 1.2345678901234567e+19

The values come from the probe behind #446 (wheels built from 62195709b7, x86-64 Linux, Python 3.12). The published arcadedb-jvm 26.11.1.post4 returned the same as the JVM column, so this belongs to the wheel and not to the engine version.

By the rule above, a DECIMAL column that holds 3 in one row and 2.5 in another comes back as an int and a float on the JVM wheel and as two floats on the native wheel. I read that from the rule, I did not run that table.

What I would do: make the JVM wheel return a float for every DECIMAL, as documented, so one column has one Python type on both wheels. A float already loses exactness for every DECIMAL that has a fraction, so the integral case does not lose a guarantee that the others have. The test in tests/test_cross_wheel_golden.py that accepts either type for Decimal("3") then asserts a float on both wheels.

Refs #314 (item 1 of the status comment of 2026-11-22).

Activity

  1. added this to the 26.12.1 milestone on Nov 22, 2026
  2. self-assigned this
    on Nov 22, 2026
  3. added
    bug
    python
    native
    jvm
    on Nov 22, 2026
  4. added
    in progress
    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

bugin progressjvmnativepython

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions