Skip to content

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

Open
jonasdedden wants to merge 1 commit into
lance-format:mainfrom
jonasdedden:compat/ray-arrow-backed-pandas
Open

test: support ray >= 2.56 Arrow-backed pandas conversion#5284
jonasdedden wants to merge 1 commit into
lance-format:mainfrom
jonasdedden:compat/ray-arrow-backed-pandas

Conversation

@jonasdedden

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 the 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.

uv.lock moves ray 2.53.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.53.0 and 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 the
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`.

uv.lock moves ray 2.53.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.53.0 and 2.55.0.
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.

1 participant