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