Repository navigation
Conversation
The TsFile builder imported the third-party `tsfile` SDK inside `_scan_metadata` without a guard, surfacing a bare `ModuleNotFoundError` to users and to the dataset-viewer workers. Scope note: this is a usability and packaging fix. It does not fix the Format filter reported in huggingface#8499 — `tsfile` is not registered in the Hub's format taxonomy, which accounts for that symptom on its own and is not actionable in this repository. It also does not fix Hub-inspect / streaming file-open failures (separate PR). On Python 3.10-3.13 the SDK cannot co-install with `datasets` (pyarrow<20 vs pyarrow>=21); the ImportError must say so, because an environment-marked `datasets[tsfile]` extra is silently empty there. - raise a version-aware ImportError (point at `datasets[tsfile]` only on 3.14+) - declare `tsfile>=2.3.0; python_version >= '3.14'` and mirror it in test extras - document the `.tsfile` extension and the 3.14+ co-install constraint - add missing-SDK and message tests; keep round-trips behind `require_tsfile` Refs huggingface#8499, huggingface#8160 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Status (2026-10-07): I have converted this PR to a draft. Its premise no longer holds on
Question for the maintainers before any rework: is an import guard or a |
|
Closing. The version-aware guard and the Python-version marker proposed here worked around the I used Claude Code to prepare this comment. |
Summary
ImportErrorwhen the Apache TsFile SDK is missing: point atpip install 'datasets[tsfile]'only on Python 3.14+, and explain the pyarrow conflict on 3.10 to 3.13.tsfile>=2.3.0; python_version >= '3.14'(mirrored in test/dev extras) and install it in the py3.14 CI job viadatasets[tsfile]..tsfileextension and the 3.14+ co-install constraint; add missing-SDK / message tests (round-trips stay behindimportorskip/require_tsfile).Scope note
This does not fix the empty Format filter reported in #8499.
tsfileis not a registered value in the Hub's format tag taxonomy, which accounts for that symptom on its own and is not actionable in this repository. Hub-inspect / streaming file-open failures are also out of scope (separate PR).Why the extra alone is not enough
Environment markers make
pip install 'datasets[tsfile]'succeed while installing nothing on Python 3.10 to 3.13. An error message that only says "install the extra" sends the user in a loop. The guard must be version-aware.pyarrowpindatasets>=18,<20>=21>=22,<24>=21Question for maintainers (Q1)
Packaging policy: keep the silent environment marker (current default in this PR), or drop the marker so
pip install 'datasets[tsfile]'fails loudly withResolutionImpossibleon 3.10 to 3.13?This is a project packaging preference; the diff keeps the marker and will follow whatever you prefer.
Supersedes
Supersedes closed #8514. That branch's commit message linked the unguarded import to the Format facet; this link has since been refuted, and the correction is in a comment on that PR. This PR is a fresh branch from
mainwith the version-aware guard.Test plan
pytest tests/packaged_modules/test_tsfile_guard.py(2 passed)ruff checkon touched Python filestests/packaged_modules/test_tsfile.pyround-trips (py3.14 CI /importorskiplocally)Refs