jorisvandenbossche commented on a change in pull request #11855:
URL: https://github.com/apache/arrow/pull/11855#discussion_r763309088
##########
File path: python/pyarrow/tests/test_array.py
##########
@@ -891,6 +891,14 @@ def test_list_from_arrays(list_array_type,
list_type_factory):
result.validate(full=True)
+def test_map_labelled():
+ t = pa.map_(pa.field("name", "string", nullable=False), "int64")
+ arr = pa.array([[('a', 1), ('b', 2)], [('c', 3)]], type=t)
+ assert arr.type.key_field == pa.field("name", pa.utf8(), nullable=False)
Review comment:
For for this PR (maybe for a new JIRA), but it seems we are not very
consistent in this. For example for list type it seems to matter:
```
In [6]: l1 = pa.list_(pa.field("val", pa.int64()))
In [7]: l2 = pa.list_(pa.int64())
In [8]: l1
Out[8]: ListType(list<val: int64>)
In [9]: l2
Out[9]: ListType(list<item: int64>)
In [10]: l1 == l2
Out[10]: False
```
Although for a map type, the name of the key field is maybe less important
than the values for a list array
--
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]