Skip to content

Commit

Permalink
remove strings_to_categorical for string_view changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Jan 5, 2025
1 parent 940b64d commit 70a2c3c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/pyarrow/src/arrow/python/arrow_to_pandas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2523,8 +2523,7 @@ Status ConvertCategoricals(const PandasOptions& options, ChunkedArrayVector* arr
}
if (options.strings_to_categorical) {
for (int i = 0; i < static_cast<int>(arrays->size()); i++) {
if (is_base_binary_like((*arrays)[i]->type()->id()) ||
is_binary_view_like((*arrays)[i]->type()->id())) {
if (is_base_binary_like((*arrays)[i]->type()->id())) {
columns_to_encode.push_back(i);
}
}
Expand Down Expand Up @@ -2558,8 +2557,7 @@ Status ConvertChunkedArrayToPandas(const PandasOptions& options,
py_ref = nullptr;
}

if (options.strings_to_categorical && (is_base_binary_like(arr->type()->id()) ||
is_binary_view_like(arr->type()->id()))) {
if (options.strings_to_categorical && is_base_binary_like(arr->type()->id())) {
if (options.zero_copy_only) {
return Status::Invalid("Need to dictionary encode a column, but ",
"only zero-copy conversions allowed");
Expand Down

0 comments on commit 70a2c3c

Please sign in to comment.