Skip to content

test: support ray >= 2.56 Arrow-backed pandas conversion - #5284

Merged
yanghua merged 1 commit into
lance-format:mainfrom
jonasdedden:compat/ray-arrow-backed-pandas
Sep 30, 2026
Merged

yanghua merged 1 commit into
lance-format:mainfrom
jonasdedden:compat/ray-arrow-backed-pandas

Conversation

@jonasdedden

@jonasdedden jonasdedden commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Ray 2.56 turned on DataContext.enable_arrow_backed_pandas_conversion, so Dataset.to_pandas() now maps Arrow types onto pd.ArrowDtype instead of numpy dtypes. Seven tests compared those frames against plain pandas frames and Python literals and started failing: two on dtype (int64 vs int64[pyarrow]) and five on nulls (None vs pd.NA).

lance_ray itself is unaffected - it drives Ray with batch_format="pyarrow" throughout - so the fix is confined to those assertions. to_numpy_backed() normalises a frame back to numpy dtypes and is a no-op when no column is Arrow-backed, which keeps the assertions exact on both sides of the 2.56 release rather than relaxing them with check_dtype=False. It is applied only where a frame is compared against numpy-backed data or None; tests that compare two Ray frames are left as is.

uv.lock moves ray 2.55.0 -> 2.58.0 so CI exercises the new default.

Verified: full suite green on ray 2.58.0, and the three touched files green on 2.55.0.

Ray 2.56 turned on `DataContext.enable_arrow_backed_pandas_conversion`, so
`Dataset.to_pandas()` now maps Arrow types onto `pd.ArrowDtype` instead of
numpy dtypes. Seven tests compared those frames against plain pandas frames
and Python literals and started failing: two on dtype (`int64` vs
`int64[pyarrow]`) and five on nulls (`None` vs `pd.NA`).

`lance_ray` itself is unaffected - it drives Ray with
`batch_format="pyarrow"` throughout - so the fix is confined to those
assertions. `to_numpy_backed()` normalises a frame back to numpy dtypes and
is a no-op when no column is Arrow-backed, which keeps the assertions exact
on both sides of the 2.56 release rather than relaxing them with
`check_dtype=False`. It is applied only where a frame is compared against
numpy-backed data or `None`; tests that compare two Ray frames are left as is.

uv.lock moves ray 2.55.0 -> 2.58.0 so CI exercises the new default.

Verified: full suite green on ray 2.58.0, and the three touched files green
on 2.55.0.
@jonasdedden
jonasdedden force-pushed the compat/ray-arrow-backed-pandas branch from 097b3f1 to 1b6b885 Compare September 28, 2026 05:34
@jonasdedden

Copy link
Copy Markdown
Contributor Author

@yanghua @ddupg @plotor any reviews? :) Simplified the PR somewhat in 1b6b885.

@yanghua yanghua left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yanghua
yanghua merged commit 69598b2 into lance-format:main Sep 30, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants