Repository navigation
Preserve interval endpoint dtypes when converting to pandas #24071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
9a8360a
3569a9d
23c8e28
7932d76
87df502
3c08172
7dbdd9d
692c0f5
3580ee0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1695,6 +1695,25 @@ def test_at_setitem_empty(): | |
| tm.assert_frame_equal(df, expected) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("closed", ["left", "right", "both", "neither"]) | ||
| @pytest.mark.parametrize("tz", ["US/Eastern", "Asia/Kolkata"]) | ||
| def test_timezone_interval_fast_to_slow(monkeypatch, closed, tz): | ||
| breaks = pd.DatetimeIndex( | ||
| list(pd.date_range("2025-03-08", periods=4, tz=tz)) | ||
| ) | ||
| expected = pd.IntervalIndex.from_breaks( | ||
| breaks, closed=closed, name="intervals" | ||
| ) | ||
| monkeypatch.setenv("CUDF_PANDAS_FAIL_ON_FALLBACK", "1") | ||
|
|
||
| result = xpd.IntervalIndex.from_breaks( | ||
| breaks, closed=closed, name="intervals" | ||
| ) | ||
|
|
||
| assert isinstance(result._fsproxy_fast, cudf.IntervalIndex) | ||
| pd.testing.assert_index_equal(result._fsproxy_slow, expected) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this just use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "index", | ||
| [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these calls needs to pass though
nullableandarrow_type?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both flags are false here. Arrow conversion returns earlier, and native intervals raise for
nullable=True. I simplified the guard and verified all four flag combinations.