Skip to content

to_dataframe: an integer above 2**53 next to a float is rounded by pandas, the other readers keep it exact #340

Closed

Description

@tae898

Found while writing the docs for the 26.11.1.post1 candidate (the docs branch read the code of #331 and checked the behaviour with pandas).

For a result column that holds an integer above 2**53 next to a floating point value, the readers of #331 keep the integer exact: to_columns() returns an exact Python list, and to_arrow() and to_polars() return a string column of the exact text. to_dataframe() is the exception: it hands the exact list to pandas, which infers float64 and rounds the integer. The same data therefore gives an exact value in three readers and a rounded one in the fourth.

Proposal: build such a column as an object Series in to_dataframe() (both wheels share the decoder, so the change is in one place), and add a test next to the 2**60 + 1 and 1.5 cases that #331 already has for to_columns() and to_arrow(). It is not part of 26.11.1.post1: that candidate is built and tested, and this changes a reader's output type for a rare shape. It goes into the next patch.

Activity

  1. added this to the 26.12.1 milestone on Nov 9, 2026
  2. self-assigned this
    on Nov 9, 2026
  3. tae898 commented on Nov 10, 2026

    @tae898
    CollaboratorAuthor

    Fixed in the tag 26.11.1.post2 (commit 4d2db17). to_dataframe() now returns a result column that holds an integer beyond 253 next to a float as an object column of the same Python values, so the integer stays exact, as in to_columns(). The tests sit next to the 2**60 + 1 and 1.5 cases of #331, and the same shape with the ends of int64 and a null. Integers alone stay int64, and integers up to 253 next to floats stay float64.

    On PyPI: arcadedb-jvm 26.11.1.post2 (4 wheels, first upload 2026-11-10 11:55 UTC) and arcadedb 26.11.1.post2 (4 wheels, first upload 2026-11-10 12:25 UTC), none yanked. The published wheels pass the #340 case in a fresh environment.

    Left alone on purpose: to_dataframe(convert_types=False) on the JVM wheel and its no-bridge fallback still round such a column, and an integer column with a null stays float64 with NaN, which is the pandas rule. If you hit either, tell me here and I will open a follow-up.

    The fix is on main with #351 (merge commit 6619f13). I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pythonPull requests that update python code

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions