Skip to content

data infer-dialect cannot infer .json / .jsonl files #14

Description

@roll

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"}).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions