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

Function test_read_column_selection

python/pyarrow/tests/test_feather.py:752–766  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

750
751@pytest.mark.pandas
752def test_read_column_selection(version):
753 # ARROW-8641
754 df = pd.DataFrame(np.arange(12).reshape(4, 3), columns=['a', 'b', 'c'])
755
756 # select columns as string names or integer indices
757 _check_pandas_roundtrip(
758 df, columns=['a', 'c'], expected=df[['a', 'c']], version=version)
759 _check_pandas_roundtrip(
760 df, columns=[0, 2], expected=df[['a', 'c']], version=version)
761
762 # different order is followed
763 _check_pandas_roundtrip(
764 df, columns=['b', 'a'], expected=df[['b', 'a']], version=version)
765 _check_pandas_roundtrip(
766 df, columns=[1, 0], expected=df[['b', 'a']], version=version)
767
768
769def test_read_column_duplicated_selection(tempdir, version):

Callers

nothing calls this directly

Calls 1

_check_pandas_roundtripFunction · 0.70

Tested by

no test coverage detected