| 2013 | |
| 2014 | |
| 2015 | def test_table_maps_as_pydicts(): |
| 2016 | arrays = [ |
| 2017 | pa.array( |
| 2018 | [{'x': 1, 'y': 2}, {'z': 3}], |
| 2019 | type=pa.map_(pa.string(), pa.int32()) |
| 2020 | ) |
| 2021 | ] |
| 2022 | table = pa.Table.from_arrays(arrays, names=['a']) |
| 2023 | |
| 2024 | table_dict = table.to_pydict(maps_as_pydicts="strict") |
| 2025 | assert 'a' in table_dict |
| 2026 | column_list = table_dict['a'] |
| 2027 | assert len(column_list) == 2 |
| 2028 | assert column_list == [{'x': 1, 'y': 2}, {'z': 3}] |
| 2029 | |
| 2030 | table_list = table.to_pylist(maps_as_pydicts="strict") |
| 2031 | assert len(table_list) == 2 |
| 2032 | assert table_list == [{'a': {'x': 1, 'y': 2}}, {'a': {'z': 3}}] |
| 2033 | |
| 2034 | |
| 2035 | def test_concat_tables(): |