HyukjinKwon opened a new pull request, #48451:
URL: https://github.com/apache/arrow/pull/48451

   ### Rationale for this change
   
   This is the ticket mentioned in https://github.com/apache/arrow/pull/7659 
which implements unsigned dictionary indices in pandas conversion.
   
   The reason why it was not implement was:
   
   pandas Categorical uses -1 to represent null values, which cannot be 
properly represented in unsigned integer types. Simply adding the unsigned 
cases would have caused:
   
   - uint8: -1 wraps to 255
   - uint16: -1 wraps to 65535
   
   ### What changes are included in this PR?
   
   Implements unsigned dictionary indices in pandas conversion
   
   ### Are these changes tested?
   
   Yes via:
   
   ```
   pytest -xvs python/pyarrow/tests/test_pandas.py::test_dictionary_with_pandas
   ```
   
   ### Are there any user-facing changes?
   
   Yes, `pd.Categorical.from_codes(indices, categories=dictionary)` with 
unsigned integers should work now as demonstrated in the tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to