Popping item from categorical series returns index instead of value
rwedge opened this issue · 3 comments
rwedge commented
This was using koalas 1.8.1
>>> import databricks.koalas as ks
>>> series = ks.Series(['a', 'b', 'c', 'a'])
>>> cat_series = series.astype('category')
>>> series.pop(0)
'a'
>>> cat_series.pop(0)
0
>>> cat_series
1 b
2 c
3 a
dtype: category
Categories (3, object): ['a', 'b', 'c']
I would expect pop to return 'a' in this case, which is what a pandas categorical series would do
HyukjinKwon commented
cc @ueshin @xinrong-databricks FYI
HyukjinKwon commented
Would you mind filing a JIRA in https://issues.apache.org/jira/projects/SPARK?
xinrong-meng commented
Thanks for letting us know!
https://issues.apache.org/jira/browse/SPARK-36771 is created for this issue.