edponce commented on a change in pull request #12081:
URL: https://github.com/apache/arrow/pull/12081#discussion_r780837727



##########
File path: python/pyarrow/pandas_compat.py
##########
@@ -934,7 +934,7 @@ def _reconstruct_index(table, index_descriptors, 
all_columns):
                                                     descr['stop'],
                                                     step=descr['step'],
                                                     name=index_name)
-            if len(index_level) != len(table):
+            if len(index_level) != len(table) and len(table) != 0:
                 # Possibly the result of munged metadata

Review comment:
       Nit: I would exchange the checks to make it more clear when this code 
path applies, and should resolve better for interpreter/compiler.
   ```python
   if len(table) > 0 and len(index_level) != len(table):
      ...
   ```




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to