Skip to content

README example validate_dataset({...}) raises AttributeError on dict input #15

@roll

Description

@roll

README/docs example validate_dataset({"resources": "bad"}) raises AttributeError (dict input unsupported).

Environment

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

Repro (verbatim from README.md / docs/python.md)

from fairspec import validate_dataset
report = validate_dataset({"resources": "bad"})
print(report.valid)

Actual

AttributeError: 'dict' object has no attribute 'model_dump'

Passing a model works:

from fairspec import Dataset, validate_dataset
validate_dataset(Dataset(resources=[])).valid   # True

So validate_dataset only accepts a Dataset model, but the documented public example passes a plain dict.

Expected: either accept a dict descriptor (coerce/validate it) as the docs show, or update the docs — the README example should run as written.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions