def open_head(fs, path, compression): """Open a file just to read its head and size""" from dask.bytes.core import OpenFile, logical_size with OpenFile(fs, path, compression=compression) as f: head = read_header(f) size = logical_size(fs, path, compression) return head, size
def test_getsize(fmt): compress = compression.compress[fmt] with filetexts({'.tmp.getsize': compress(b'1234567890')}, mode='b'): fs = LocalFileSystem() assert logical_size(fs, '.tmp.getsize', fmt) == 10
def test_getsize(fmt): compress = compression.compress[fmt] with filetexts({".tmp.getsize": compress(b"1234567890")}, mode="b"): fs = LocalFileSystem() assert logical_size(fs, ".tmp.getsize", fmt) == 10