| 1237 | |
| 1238 | @pytest.mark.numpy |
| 1239 | def test_recordbatch_to_tensor_empty(): |
| 1240 | batch = pa.RecordBatch.from_arrays( |
| 1241 | [ |
| 1242 | pa.array([], type=pa.float32()), |
| 1243 | pa.array([], type=pa.float32()), |
| 1244 | ], ["a", "b"] |
| 1245 | ) |
| 1246 | result = batch.to_tensor() |
| 1247 | |
| 1248 | x = np.column_stack([[], []]).astype(np.float32, order="F") |
| 1249 | expected = pa.Tensor.from_numpy(x) |
| 1250 | |
| 1251 | assert result.size == expected.size |
| 1252 | assert result.type == pa.float32() |
| 1253 | assert result.shape == expected.shape |
| 1254 | assert result.strides == (4, 4) |
| 1255 | |
| 1256 | |
| 1257 | def test_recordbatch_to_tensor_unsupported(): |