Skip to content

fix(dataset): default missing sample metadata to an empty dict - #1806

Open
March-7 wants to merge 1 commit into
modelscope:mainfrom
March-7:codex/fieldspec-missing-metadata
Open

March-7 wants to merge 1 commit into
modelscope:mainfrom
March-7:codex/fieldspec-missing-metadata

Conversation

@March-7

@March-7 March-7 commented Oct 4, 2026

Copy link
Copy Markdown

Loading ordinary input/target records with the default FieldSpec currently passes metadata=None into Sample, which rejects it because metadata must be a dictionary. Initialize a fresh empty dictionary for each record so DictDataLoader and CSV/JSONL imports accept omitted metadata, matching Sample's default.

Add regression coverage for omitted metadata, dictionary isolation between samples and reloads, explicit dictionary/JSON metadata, selected fields, and rejection of null or malformed metadata. Existing benchmark conversion and scoring semantics are unchanged.

Validation: make dev, make lint, 55 dataset loader/builder tests, 9 default-adapter tests, and the unchanged tests/cli/test_all.py::TestRun::test_ci_lite passed. The smoke test used its built-in mock model and the official 120-record IQuiz dataset cached beforehand; socket connections were blocked during test execution. A separate 10-case offline oracle changed from 4 failures to all passing.

Prepared with GPT-6 Astra in Codex. No live model calls were used.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant