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

Function test_chunked_binary_error_message

python/pyarrow/tests/test_feather.py:736–755  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

734@pytest.mark.large_memory
735@pytest.mark.pandas
736def test_chunked_binary_error_message():
737 # ARROW-3058: As Feather does not yet support chunked columns, we at least
738 # make sure it's clear to the user what is going on
739
740 # 2^31 + 1 bytes
741 values = [b'x'] + [
742 b'x' * (1 << 20)
743 ] * 2 * (1 << 10)
744 df = pd.DataFrame({'byte_col': values})
745
746 # Works fine with version 2
747 buf = io.BytesIO()
748 write_feather(df, buf, version=2)
749 result = read_feather(pa.BufferReader(buf.getvalue()))
750 assert_frame_equal(result, df)
751
752 with pytest.raises(ValueError, match="'byte_col' exceeds 2GB maximum "
753 "capacity of a Feather binary column. This restriction "
754 "may be lifted in the future"):
755 write_feather(df, io.BytesIO(), version=1)
756
757
758def test_feather_without_pandas(tempdir, version):

Callers

nothing calls this directly

Calls 3

write_featherFunction · 0.90
read_featherFunction · 0.90
BufferReaderMethod · 0.80

Tested by

no test coverage detected