Skip to content

Commit

Permalink
Gate ArrowStringArrayNumpySemantics cudf.pandas proxy behind version …
Browse files Browse the repository at this point in the history
…check (#16401)

## Description
`ArrowStringArrayNumpySemantics` was newly added in 2.1:
https://github.com/pandas-dev/pandas/blob/2.1.x/pandas/core/arrays/string_arrow.py#L488,
so putting the proxy wrapper behind a version check for pandas 2.0.x
compat

```ipython
In [1]: %load_ext cudf.pandas

In [2]: import pandas as pd

In [3]: pd.__version__
Out[3]: '2.0.0'
```

## Checklist
- [ ] I am familiar with the [Contributing
Guidelines](https://github.com/rapidsai/cudf/blob/HEAD/CONTRIBUTING.md).
- [ ] New or existing tests cover these changes.
- [ ] The documentation is up to date with these changes.
  • Loading branch information
mroeschke authored Jul 26, 2024
1 parent 1cea1ea commit cd762b4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions python/cudf/cudf/pandas/_wrappers/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)

import cudf
import cudf.core._compat

from ..annotation import nvtx
from ..fast_slow_proxy import (
Expand Down Expand Up @@ -556,13 +557,14 @@ def Index__setattr__(self, name, value):
},
)

ArrowStringArrayNumpySemantics = make_final_proxy_type(
"ArrowStringArrayNumpySemantics",
_Unusable,
pd.core.arrays.string_arrow.ArrowStringArrayNumpySemantics,
fast_to_slow=_Unusable(),
slow_to_fast=_Unusable(),
)
if cudf.core._compat.PANDAS_GE_210:
ArrowStringArrayNumpySemantics = make_final_proxy_type(
"ArrowStringArrayNumpySemantics",
_Unusable,
pd.core.arrays.string_arrow.ArrowStringArrayNumpySemantics,
fast_to_slow=_Unusable(),
slow_to_fast=_Unusable(),
)

ArrowStringArray = make_final_proxy_type(
"ArrowStringArray",
Expand Down

0 comments on commit cd762b4

Please sign in to comment.