You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ossie.apache.org by "ayushtkn (via GitHub)" <gi...@apache.org> on 2026/10/04 07:54:12 UTC

[PR] fix(python): reject empty identifiers, as the core schema does [ossie]

ayushtkn opened a new pull request, #511:
URL: https://github.com/apache/ossie/pull/511

   ## Summary
   `core-spec/ossie-schema.json` sets `minLength: 1` on every identifier, but the Python
   models carried no matching constraint. The package therefore accepted an empty name and
   `to_ossie_yaml()` serialized a document that the schema then refuses:
   
       >>> doc = OssieDocument(name="", datasets=[OssieDataset(name="", source="", fields=[...])])
       >>> open("m.yaml", "w").write(doc.to_ossie_yaml())
   
       $ python validation/validate.py m.yaml
       Validation FAILED with 4 error(s):
         [Schema] name: '' should be non-empty
         [Schema] datasets -> 0 -> name: '' should be non-empty
         [Schema] datasets -> 0 -> source: '' should be non-empty
         [Schema] datasets -> 0 -> fields -> 0 -> name: '' should be non-empty
   
   This mirrors the constraint on all eight fields the schema constrains —
   `SemanticModel.name`, `Dataset.name`, `Dataset.source`, `Field.name`, `Metric.name`,
   and `Relationship.name` / `from` / `to` — completing what #194 did for the list fields
   carrying the schema's `minItems`. Construction now fails where it used to emit an
   invalid document:
   
       ValidationError: 1 validation error for OssieField
       name
         String should have at least 1 character [type=string_too_short, input_value='', input_type=str]
   
   The validator already reports empty names and refs (#414) and the schema already
   rejects them, so the SDK was the last layer not enforcing it.
   
   **No behaviour change for valid documents.** Every Python suite in the repo passes
   unmodified: `python` 108, dbt 168, sigma 103, wisdom 37, nvidia 85, omni 105,
   gooddata 94, honeydew 151, orionbelt 269, snowflake 119
   
   ## Related Issues
   
   NA
   
   ## Checklist
   
   ### Specification
   - [ ] Spec changes are included in `core-spec/` and follow the existing structure
   - [ ] Spec changes have been discussed on the mailing list or in a linked issue
   - [ ] Breaking changes to the spec are clearly called out in the summary
   
   ### Ontology
   - [ ] Ontology changes in `ontology/` are consistent with spec changes
   - [ ] New or modified terms are defined and documented
   
   ### Converters
   - [ ] Converter logic in `converters/` is updated to reflect spec or ontology changes
   - [ ] New converters include tests under the converter's test directory
   - [ ] If adding a new converter, `.github/labeler.yml` is updated with the new path
   
   ### Validation
   - [ ] Validation rules in `validation/` are updated if the spec changed
   - [ ] New validation cases are covered by tests
   
   ### Documentation
   - [ ] `docs/` is updated to reflect any user-facing changes
   - [ ] New features or behaviors are documented with examples where appropriate
   - [ ] `CONTRIBUTING.md` is updated if the contribution process changed
   
   ### Examples
   - [ ] `examples/` are added or updated for any new spec constructs or converter support
   
   ### Tests
   - [ ] All existing tests pass (`pytest` / CI green)
   - [ ] New functionality is covered by tests
   
   ### Compliance
   - [ ] ASF license headers are present on all new source files
   - [ ] No third-party dependencies are added without PMC/IPMC approval
   - [ ] If third-party source code is vendored/copied (not just declared as a dependency), `NOTICE` and/or `LICENSE` have been updated per [ASF policy](https://infra.apache.org/licensing-howto.html)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(python): reject empty identifiers, as the core schema does [ossie]

Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #511:
URL: https://github.com/apache/ossie/pull/511


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org