(version)
| 290 | |
| 291 | @pytest.mark.pandas |
| 292 | def test_integer_with_nulls(version): |
| 293 | # pandas requires upcast to float dtype |
| 294 | path = random_path() |
| 295 | TEST_FILES.append(path) |
| 296 | |
| 297 | int_dtypes = ['i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8'] |
| 298 | num_values = 100 |
| 299 | |
| 300 | arrays = [] |
| 301 | null_mask = np.random.randint(0, 10, size=num_values) < 3 |
| 302 | expected_cols = [] |
| 303 | for name in int_dtypes: |
| 304 | values = np.random.randint(0, 100, size=num_values) |
| 305 | arrays.append(pa.array(values, mask=null_mask)) |
| 306 | |
| 307 | expected = values.astype('f8') |
| 308 | expected[null_mask] = np.nan |
| 309 | |
| 310 | expected_cols.append(expected) |
| 311 | |
| 312 | table = pa.table(arrays, names=int_dtypes) |
| 313 | _check_arrow_roundtrip(table) |
| 314 | |
| 315 | df = table.to_pandas() |
| 316 | _check_pandas_roundtrip(df, version=version) |
| 317 | |
| 318 | |
| 319 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected