fsspec / fsspec/filesystem_spec

Reference Filesystem: "ValueError: Compression type zstd not supported"

Open
#1,044 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

When opening a zstd compressed reference file using:

fs = fsspec.filesystem("reference", fo='s3://esip-qhub-public/ecmwf/ERA5_2020_2022_multivar.json.zst', ref_storage_args= {"compression": "zstd"}, remote_protocol='s3', remote_options={'anon':True})

I get the error:

Traceback (most recent call last):
  File "/home/peter/Documents/intake_test/test_local.py", line 3, in <module>
    fs = fsspec.filesystem("reference", fo='ERA5_2020_2022_multivar.json.zst',ref_storage_args={"compression": "zstd"})
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/registry.py", line 262, in filesystem
    return cls(**storage_options)
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/spec.py", line 76, in __call__
    obj = super().__call__(*args, **kwargs)
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/implementations/reference.py", line 140, in __init__
    with open(fo, "rb", **dic) as f:
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/core.py", line 467, in open
    return open_files(
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/core.py", line 312, in open_files
    [
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/core.py", line 313, in <listcomp>
    OpenFile(
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/core.py", line 74, in __init__
    self.compression = get_compression(path, compression)
  File "/home/peter/anaconda3/envs/open_intake_min/lib/python3.10/site-packages/fsspec/core.py", line 513, in get_compression
    raise ValueError("Compression type %s not supported" % compression)
ValueError: Compression type zstd not supported

This occurs in a clean environment with the latest fsspec and s3fs installed. Running pip install zstandard fixes the error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in a clean environment using the Reference Filesystem example and inspect fsspec/core.py together with fsspec/implementations/reference.py, the locations shown in the traceback. Check how the zstd compression option is resolved and how the optional zstandard dependency is handled. Done means the reported zstd workflow behaves as intended or its dependency requirement is explicitly covered by the project.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.