Example #1
0
def test_formats_for_format():
    bytes_fmt = FormatRegistry.for_format('bytes')[0]
    json_fmt = FormatRegistry.for_format('json')[0]

    some_bytes = b'["phlipper", "piglet"]'
    assert bytes_fmt.serialize(some_bytes)[0] == some_bytes
    assert json_fmt.deserialize(some_bytes) == ['phlipper', 'piglet']
Example #2
0
def test_buggy_parquet():
    """
    Test that Quilt avoids crashing on bad Pandas metadata from
    old pyarrow libaries.
    """
    path = pathlib.Path(__file__).parent
    for parquet_handler in FormatRegistry.for_format('parquet'):
        with open(path / 'data' / 'buggy_parquet.parquet', 'rb') as bad_parq:
            # Make sure this doesn't crash.
            parquet_handler.deserialize(bad_parq.read())