diff --git a/fsspec/implementations/reference.py b/fsspec/implementations/reference.py index 218149d80..d5d3f2968 100644 --- a/fsspec/implementations/reference.py +++ b/fsspec/implementations/reference.py @@ -136,11 +136,6 @@ def __init__( Engine choice for reading parquet files. (default is "fastparquet") """ - from importlib.util import find_spec - - if find_spec("pyarrow") is None: - raise ImportError("engine choice `pyarrow` is not installed.") - self.root = root self.chunk_sizes = {} self.out_root = out_root or self.root @@ -151,6 +146,11 @@ def __init__( # TODO: derive fs from `root` self.fs = fsspec.filesystem("file") if fs is None else fs + from importlib.util import find_spec + + if self.engine == "pyarrow" and find_spec("pyarrow") is None: + raise ImportError("engine choice `pyarrow` is not installed.") + def __getattr__(self, item): if item in ("_items", "record_size", "zmetadata"): self.setup() @@ -480,7 +480,7 @@ def write(self, field, record, base_url=None, storage_options=None): self.fs.mkdirs(f"{base_url or self.out_root}/{field}", exist_ok=True) if self.engine == "pyarrow": - df_backend_kwargs = {} + df_backend_kwargs = {"write_statistics": False} elif self.engine == "fastparquet": df_backend_kwargs = { "stats": False,