MCPcopy Create free account
hub / github.com/apache/arrow / test_strings

Function test_strings

python/pyarrow/tests/test_feather.py:403–424  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

401
402@pytest.mark.pandas
403def test_strings(version):
404 repeats = 1000
405
406 # Mixed bytes, unicode, strings coerced to binary
407 values = [b'foo', None, 'bar', 'qux', np.nan]
408 df = pd.DataFrame({'strings': values * repeats})
409
410 ex_values = [b'foo', None, b'bar', b'qux', None]
411 expected = pd.DataFrame({'strings': ex_values * repeats})
412 _check_pandas_roundtrip(df, expected, version=version)
413
414 # embedded nulls are ok
415 values = ['foo', None, 'bar', 'qux', None]
416 df = pd.DataFrame({'strings': values * repeats})
417 expected = pd.DataFrame({'strings': values * repeats})
418 _check_pandas_roundtrip(df, expected, version=version)
419
420 values = ['foo', None, 'bar', 'qux', np.nan]
421 df = pd.DataFrame({'strings': values * repeats})
422 ex_values = ['foo', None, 'bar', 'qux', None]
423 expected = pd.DataFrame({'strings': ex_values * repeats})
424 _check_pandas_roundtrip(df, expected, version=version)
425
426
427@pytest.mark.pandas

Callers

nothing calls this directly

Calls 1

_check_pandas_roundtripFunction · 0.70

Tested by

no test coverage detected