ontology: `spec.py` Pydantic models reject spec-conformant documents carrying `datatype`

Open Beginner friendly
#424 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start in converters/ontology/src/ossie_ontology/spec.py, inspecting DatasetField, Metric, and the base OssieObject configuration. Reproduce the failure with examples/tpcds_semantic_model.yaml or the documented SemanticModel input, then verify that documents carrying datatype parse successfully without extra_forbidden errors.

Written by the indexing model from the issue text.

Description

Summary

converters/ontology/src/ossie_ontology/spec.py DatasetField and Metric omit datatype, while the base OssieObject sets extra="forbid". Any conformant document with datatype (including examples/tpcds_semantic_model.yaml) fails to parse with extra_forbidden.

Root cause

extra="forbid" + no datatype field on DatasetField/Metric, though the core spec defines datatype on both.

Repro (real converter, HEAD ab8fc1a — EXECUTED)

SemanticModel(**doc) with a field datatype: Integer:

1 validation error for SemanticModel
datasets.0.fields.0.datatype
  Extra inputs are not permitted [type=extra_forbidden, input_value='Integer', input_type=str]
Potential fix

Add datatype: str | None = None to DatasetField and Metric. This should be a non-breaking change. Value-enum validation is a separate, optional concern.

Dominant language
Python
Stars
2.2k
Forks
280
Avg merge
2d 7h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/ossie

All issues in apache/ossie

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.