(uint, int, float, np_float_str, use_batch)
| 214 | ) |
| 215 | @pytest.mark.parametrize("use_batch", [False, True]) |
| 216 | def test_get_columns(uint, int, float, np_float_str, use_batch): |
| 217 | arr = [[1, 2, 3], [4, 5]] |
| 218 | arr_float = np.array([1, 2, 3, 4, 5], dtype=np.dtype(np_float_str)) |
| 219 | table = pa.table( |
| 220 | { |
| 221 | "a": pa.chunked_array(arr, type=uint), |
| 222 | "b": pa.chunked_array(arr, type=int), |
| 223 | "c": pa.array(arr_float, type=float) |
| 224 | } |
| 225 | ) |
| 226 | if use_batch: |
| 227 | table = table.combine_chunks().to_batches()[0] |
| 228 | df = table.__dataframe__() |
| 229 | for col in df.get_columns(): |
| 230 | assert col.size() == 5 |
| 231 | assert col.num_chunks() == 1 |
| 232 | |
| 233 | # 0 = DtypeKind.INT, 1 = DtypeKind.UINT, 2 = DtypeKind.FLOAT, |
| 234 | # see DtypeKind class in column.py |
| 235 | assert df.get_column(0).dtype[0] == 1 # UINT |
| 236 | assert df.get_column(1).dtype[0] == 0 # INT |
| 237 | assert df.get_column(2).dtype[0] == 2 # FLOAT |
| 238 | |
| 239 | |
| 240 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected