fsspec / fsspec/filesystem_spec

Inconsistencies: `ls` may have `detail=True` or `detail=False`

Open
#1,205 1 comment 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

I saw the AbstractArchiveFileSystem switched to detail=True in https://github.com/fsspec/filesystem_spec/commit/0f3ecd8e629043646ab19b1a2b00d895f0553a81.

There are some inconstencies with other filesystems which have detail=False (e.g. the local filesystem).

with fsspec==2023.3.0

Currently:

>>> import fsspec
>>> url = "https://huggingface.co/datasets/lhoestq/test_zip_txt/resolve/main/atoz.zip"
>>> fs = fsspec.filesystem("zip", fo=url)
>>> fs.ls("")
[{'orig_filename': 'atoz/',
  'filename': 'atoz/',
  'date_time': (2021, 12, 8, 1, 15, 4),
  'compress_type': 0,
  '_compresslevel': None,
  'comment': b'',
  'extra': b'\n\x00 \x00\x00\x00\x00\x00\x01\x00\x18\x00\x99;\xf6\xa4\xc8\xeb\xd7\x01\x99;\xf6\xa4\xc8\xeb\xd7\x01i\x9b\x84\xa7e\xe7\xd7\x01',
  'create_system': 0,
  'create_version': 63,
  'extract_version': 20,
  'reserved': 0,
  'flag_bits': 0,
  'volume': 0,
  'internal_attr': 0,
  'external_attr': 16,
  'header_offset': 0,
  'CRC': 0,
  'compress_size': 0,
  'file_size': 0,
  '_raw_time': 2530,
  'name': 'atoz/',
  'size': 0,
  'type': 'directory'}]

Previously:

>>> fs.ls("")
['atoz/']

cc @martindurant

Question: should the local file filesystem implementation have detail=True as well ?

(And is there a changelog somewhere with communication about breaking changes ?)

related: https://github.com/fsspec/filesystem_spec/issues/899

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 two fs.ls("") examples with the ZIP and local filesystem implementations, then compare their detail behavior with AbstractArchiveFileSystem. Read related issue #899 and the linked commit before determining the consistent API behavior and whether a changelog entry is needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.