You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/30 22:34:52 UTC

[GitHub] [arrow] dianaclarke opened a new pull request #8314: ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable

dianaclarke opened a new pull request #8314:
URL: https://github.com/apache/arrow/pull/8314


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] wesm closed pull request #8314: ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable

Posted by GitBox <gi...@apache.org>.
wesm closed pull request #8314:
URL: https://github.com/apache/arrow/pull/8314


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #8314: ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #8314:
URL: https://github.com/apache/arrow/pull/8314#issuecomment-701686361


   https://issues.apache.org/jira/browse/ARROW-10147


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] dianaclarke commented on a change in pull request #8314: ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable

Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #8314:
URL: https://github.com/apache/arrow/pull/8314#discussion_r498378619



##########
File path: python/pyarrow/pandas_compat.py
##########
@@ -470,7 +470,7 @@ def _get_range_index_descriptor(level):
     # public start/stop/step attributes added in pandas 0.25.0
     return {
         'kind': 'range',
-        'name': level.name,
+        'name': str(level.name) if level.name else None,

Review 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.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] wesm commented on a change in pull request #8314: ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable

Posted by GitBox <gi...@apache.org>.
wesm commented on a change in pull request #8314:
URL: https://github.com/apache/arrow/pull/8314#discussion_r498505600



##########
File path: python/pyarrow/pandas_compat.py
##########
@@ -470,7 +470,7 @@ def _get_range_index_descriptor(level):
     # public start/stop/step attributes added in pandas 0.25.0
     return {
         'kind': 'range',
-        'name': level.name,
+        'name': str(level.name) if level.name else None,

Review 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




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow] dianaclarke commented on a change in pull request #8314: ARROW-10147: [Python] Pandas metadata fails if index name not JSON-serializable

Posted by GitBox <gi...@apache.org>.
dianaclarke commented on a change in pull request #8314:
URL: https://github.com/apache/arrow/pull/8314#discussion_r498546711



##########
File path: python/pyarrow/pandas_compat.py
##########
@@ -470,7 +470,7 @@ def _get_range_index_descriptor(level):
     # public start/stop/step attributes added in pandas 0.25.0
     return {
         'kind': 'range',
-        'name': level.name,
+        'name': str(level.name) if level.name else None,

Review 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.
   
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org