(use_batch)
| 154 | |
| 155 | @pytest.mark.parametrize("use_batch", [False, True]) |
| 156 | def test_dataframe(use_batch): |
| 157 | n = pa.chunked_array([[2, 2, 4], [4, 5, 100]]) |
| 158 | a = pa.chunked_array([["Flamingo", "Parrot", "Cow"], |
| 159 | ["Horse", "Brittle stars", "Centipede"]]) |
| 160 | table = pa.table([n, a], names=['n_legs', 'animals']) |
| 161 | if use_batch: |
| 162 | table = table.combine_chunks().to_batches()[0] |
| 163 | df = table.__dataframe__() |
| 164 | |
| 165 | assert df.num_columns() == 2 |
| 166 | assert df.num_rows() == 6 |
| 167 | if use_batch: |
| 168 | assert df.num_chunks() == 1 |
| 169 | else: |
| 170 | assert df.num_chunks() == 2 |
| 171 | assert list(df.column_names()) == ['n_legs', 'animals'] |
| 172 | assert list(df.select_columns((1,)).column_names()) == list( |
| 173 | df.select_columns_by_name(("animals",)).column_names() |
| 174 | ) |
| 175 | |
| 176 | |
| 177 | @pytest.mark.parametrize("use_batch", [False, True]) |
nothing calls this directly
no test coverage detected