westonpace commented on issue #11500:
URL: https://github.com/apache/arrow/issues/11500#issuecomment-949095282


   Technically the sequence protocol does not define equality.  The problem 
seems to originate from the line `sorted(set(columns)) == columns`.  We are 
relying on `list == sequence => bool` which is not valid when the sequence is a 
numpy array (`list == np.ndarray => np.ndarray`).
   
   The [correct method for comparing 
sequences](https://stackoverflow.com/questions/900420/elegant-way-to-compare-sequences)
 seems to be converting both sides to list or using imap (although given we are 
already doing `sorted(set(columns))` I think imap would be overkill).
   
   I'm in favor of @amol- 's general point though.  Changing the docs to 
mention `list|tuple` is probably a good solution.


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