Skip to content

dataset infer output does not round-trip through dataset validate (integrity: object vs string) #13

Description

@roll

dataset infer output does not round-trip through dataset validate (integrity object vs string).

Environment

  • fairspec 0.1.4 (installed from PyPI)
  • Python 3.12.3, Linux
  • Reproduced in a clean virtualenv against the published wheel.

Repro

printf 'id,name\n1,A\n2,B\n' > products.csv
fairspec dataset infer products.csv --json > inferred.json
fairspec dataset validate inferred.json --json

Actual

{
  "valid": false,
  "errors": [
    {
      "type": "metadata",
      "message": "{'type': 'sha256', 'hash': '...'} is not of type 'string'",
      "jsonPointer": "/resources/0/integrity"
    }
  ]
}

dataset infer emits integrity as an object { "type": "sha256", "hash": "..." }, but the dataset schema requires /resources/*/integrity to be a string. An inferred descriptor therefore never validates.

Expected: dataset infer output passes dataset validate unchanged (align the emitted integrity shape with the schema, or relax the schema to accept the object form).

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