MCPcopy Create free account
hub / github.com/apache/arrow / test_read_column_duplicated_in_file

Function test_read_column_duplicated_in_file

python/pyarrow/tests/test_feather.py:782–798  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

780
781
782def test_read_column_duplicated_in_file(tempdir):
783 # duplicated columns in feather file (only works for feather v2)
784 table = pa.table([[1, 2, 3], [4, 5, 6], [7, 8, 9]], names=['a', 'b', 'a'])
785 path = str(tempdir / "data.feather")
786 write_feather(table, path, version=2)
787
788 # no selection works fine
789 result = read_table(path)
790 assert result.equals(table)
791
792 # selection with indices works
793 result = read_table(path, columns=[0, 2])
794 assert result.column_names == ['a', 'a']
795
796 # selection with column names errors
797 with pytest.raises(ValueError):
798 read_table(path, columns=['a', 'b'])
799
800
801def test_read_column_with_generator(tempdir, version):

Callers

nothing calls this directly

Calls 3

write_featherFunction · 0.90
read_tableFunction · 0.90
equalsMethod · 0.80

Tested by

no test coverage detected