Пример #1
0
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
Пример #2
0
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
Пример #3
0
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
Пример #4
0
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
Пример #5
0
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