Commit de6eb89
authored
### Rationale for this change
This is the ticket mentioned in #7659 which implements unsigned dictionary indices in pandas conversion.
### What changes are included in this PR?
Implements unsigned dictionary indices by upcasting to signed ints 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.
* GitHub Issue: #47022
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Adam Reeve <[email protected]>
1 parent 9c4faee commit de6eb89
File tree
2 files changed
+49
-17
lines changed- python/pyarrow
- src/arrow/python
- tests
2 files changed
+49
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1863 | 1863 | | |
1864 | 1864 | | |
1865 | 1865 | | |
1866 | | - | |
1867 | | - | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
1868 | 1881 | | |
1869 | 1882 | | |
1870 | 1883 | | |
| |||
1875 | 1888 | | |
1876 | 1889 | | |
1877 | 1890 | | |
1878 | | - | |
| 1891 | + | |
1879 | 1892 | | |
1880 | 1893 | | |
1881 | 1894 | | |
| |||
1928 | 1941 | | |
1929 | 1942 | | |
1930 | 1943 | | |
1931 | | - | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
1932 | 1949 | | |
1933 | 1950 | | |
1934 | 1951 | | |
| |||
2024 | 2041 | | |
2025 | 2042 | | |
2026 | 2043 | | |
2027 | | - | |
2028 | | - | |
2029 | | - | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
2030 | 2047 | | |
2031 | 2048 | | |
2032 | | - | |
2033 | | - | |
| 2049 | + | |
2034 | 2050 | | |
2035 | 2051 | | |
2036 | 2052 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4114 | 4114 | | |
4115 | 4115 | | |
4116 | 4116 | | |
4117 | | - | |
4118 | | - | |
4119 | | - | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
| 4120 | + | |
4120 | 4121 | | |
4121 | 4122 | | |
4122 | 4123 | | |
4123 | 4124 | | |
4124 | | - | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
4125 | 4136 | | |
4126 | 4137 | | |
4127 | 4138 | | |
4128 | 4139 | | |
4129 | 4140 | | |
4130 | 4141 | | |
4131 | | - | |
4132 | | - | |
4133 | | - | |
4134 | | - | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
4135 | 4151 | | |
4136 | 4152 | | |
4137 | 4153 | | |
| |||
0 commit comments