ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable#8314
ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable#8314dianaclarke wants to merge 1 commit intoapache:masterfrom
Conversation
python/pyarrow/pandas_compat.py
Outdated
There was a problem hiding this comment.
Or perhaps name should be coerced to a string on RangeIndex instantiation? Perhaps there are other places where a name that's something like np.int64(6) might be problematic.
There was a problem hiding this comment.
pandas allows Index.name to be anything -- we may want to make our best effort to try to preserve the type of the name, in the worst case pickling could be necessary
There was a problem hiding this comment.
I see, that context helps, thanks! I hear name and immediately assume a string is the end goal.
I've amended the commit to at least preserve the type if default serializable. I'll noodle some more on pickling.
9c6befc to
a67dbef
Compare
…name is not JSON-serializable by default
a67dbef to
9f64984
Compare
wesm
left a comment
There was a problem hiding this comment.
+1, I think this is plenty for now -- if preserving the type of atypical names becomes important to someone they can always submit a patch to fix it later. Thanks @dianaclarke!
See: https://issues.apache.org/jira/browse/ARROW-10147
Before:
After: