[ 
https://issues.apache.org/jira/browse/ARROW-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16368642#comment-16368642
 ] 

ASF GitHub Bot commented on ARROW-2170:
---------------------------------------

cpcloud commented on a change in pull request #1623: ARROW-2170: [Python] 
construct_metadata fails on reading files where no index was preserved
URL: https://github.com/apache/arrow/pull/1623#discussion_r168962583
 
 

 ##########
 File path: python/pyarrow/pandas_compat.py
 ##########
 @@ -197,8 +197,11 @@ def construct_metadata(df, column_names, index_levels, 
index_column_names,
     -------
     dict
     """
-    df_types = types[:-len(index_levels)]
-    index_types = types[-len(index_levels):]
+    # Use ntypes instead of Python shorthand notation [:-len(x)] as [:-0]
+    # behaves differently to what we want.
 
 Review comment:
   Nice catch.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Python] construct_metadata fails on reading files where no index was 
> preserved
> -------------------------------------------------------------------------------
>
>                 Key: ARROW-2170
>                 URL: https://issues.apache.org/jira/browse/ARROW-2170
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Uwe L. Korn
>            Assignee: Uwe L. Korn
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> The current master will then just return an empty DataFrame.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to