Skip to content

Commit a501621

Browse files
jorisvandenbosscheliujiacheng777
authored andcommitted
apacheGH-35025: [Python] Remove use of deprecated pandas.Categorical fastpath keyword (apache#35026)
### Rationale for this change We are using `pd.Categorical(codes, categories, fastpath=True)`. This keyword is deprecated in pandas 2.1 and this should be changed to `pd.Categorical.from_codes(codes, categories)`. ### Are there any user-facing changes? No * Closes: apache#35025 Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
1 parent 17234d2 commit a501621

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

python/pyarrow/array.pxi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,10 +1685,9 @@ cdef wrap_array_output(PyObject* output):
16851685
cdef object obj = PyObject_to_object(output)
16861686

16871687
if isinstance(obj, dict):
1688-
return pandas_api.categorical_type(obj['indices'],
1689-
categories=obj['dictionary'],
1690-
ordered=obj['ordered'],
1691-
fastpath=True)
1688+
return _pandas_api.categorical_type.from_codes(
1689+
obj['indices'], categories=obj['dictionary'], ordered=obj['ordered']
1690+
)
16921691
else:
16931692
return obj
16941693

0 commit comments

Comments
 (0)