You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2023/04/14 08:36:52 UTC

[GitHub] [arrow] AlenkaF commented on pull request #35113: GH-35112: [Python] Expose keys_sorted in python MapType

AlenkaF commented on PR #35113:
URL: https://github.com/apache/arrow/pull/35113#issuecomment-1508145952

   The binding looks good to me also +1, thank you for the contribution!
   
   I do have a general, probably silly question, about the keyword in general. Looking at the C++ and the tests, it is meant as a "metadata" keyword and not a "check" that the data is actually sorted, right? What I mean is, you can have a `MapType` defined with `keys_sorted=True` but using it in Scalars for example, the keys do not actually have to be sorted (ascending?):
   
   ```python
   >>> ty = pa.map_(pa.string(), pa.int8(), keys_sorted=True)
   >>> v = [('b', 2), ('a', 1)]
   >>> s = pa.scalar(v, type=ty)
   >>> s
   <pyarrow.MapScalar: [('b', 2), ('a', 1)]>
   ```
   
   And Dane is correct, the failing tests are not connected to this PR.


-- 
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: github-unsubscribe@arrow.apache.org

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