data infer-dialect cannot infer dialect for .json / .jsonl files.
Environment
fairspec 0.1.4 (installed from PyPI)
- Python 3.12.3, Linux
- Reproduced in a clean virtualenv against the published wheel.
Repro
echo '[{"id":1},{"id":2}]' > users.json
printf '{"id":1}\n{"id":2}\n' > lines.jsonl
fairspec data infer-dialect users.json --json # {"error": "Could not infer dialect"}
fairspec data infer-dialect lines.jsonl --json # {"error": "Could not infer dialect"}
With --debug the underlying infer_file_dialect(Resource(data=path)) returns falsy, so commands/file_dialect/infer.py raises ValueError("Could not infer dialect").
docs/terminal/data.md documents detecting json and jsonl ({"name": "json"} / {"name": "jsonl"}), so this appears unimplemented or broken for the data path. (CSV dialect inference via table/file infer-dialect works.)
Expected: return the detected dialect ({"format": "json"} / {"format": "jsonl"}).
data infer-dialectcannot infer dialect for.json/.jsonlfiles.Environment
fairspec0.1.4 (installed from PyPI)Repro
With
--debugthe underlyinginfer_file_dialect(Resource(data=path))returns falsy, socommands/file_dialect/infer.pyraisesValueError("Could not infer dialect").docs/terminal/data.mddocuments detectingjsonandjsonl({"name": "json"}/{"name": "jsonl"}), so this appears unimplemented or broken for the data path. (CSV dialect inference viatable/file infer-dialectworks.)Expected: return the detected dialect (
{"format": "json"}/{"format": "jsonl"}).