ianmcook commented on code in PR #39516: URL: https://github.com/apache/arrow/pull/39516#discussion_r1446806459
########## python/pyarrow/tests/test_array.py: ########## @@ -1057,6 +1057,31 @@ def test_map_from_arrays(): assert result.equals(expected) + result = pa.MapArray.from_arrays(offsets, keys, items, pa.map_( + keys.type, + items.type + )) + assert result.equals(expected) + + pa.MapArray.from_arrays(offsets, keys, items, pa.map_( + keys.type, + # Bigger than the original i4, which is okay + pa.int32() + )) + assert result.equals(expected) + + with pytest.raises(pa.ArrowTypeError, match='Expected map type, got string'): + pa.MapArray.from_arrays(offsets, keys, items, pa.string()) + + with pytest.raises(pa.ArrowTypeError, match='Mismatching map items type'): + pa.MapArray.from_arrays(offsets, keys, items, pa.map_( + keys.type, + # This is not allowed + pa.string() + )) + + assert result.equals(expected) Review Comment: ```suggestion ``` I think this can be removed -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org