You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ossie.apache.org by "ntoxlut (via GitHub)" <gi...@apache.org> on 2026/08/18 18:20:16 UTC

[PR] fix(dbt): serialize osi-to-msi manifest with pydantic v1 .json() [ossie]

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

   The osi-to-msi CLI called .model_dump_json() on the converter output, but PydanticSemanticManifest (from metricflow_semantic_interfaces) subclasses pydantic.v1.BaseModel, whose serializer is .json(). As a result osi-to-msi raised AttributeError on every input, including the repository's own examples/tpcds_semantic_model.yaml.
   
   Switch to .json(by_alias=True, exclude_none=True, indent=2), which produces identical serialization options on a pydantic v1 model, and add an end-to-end CLI test that drives osi-to-msi and asserts the output is a valid semantic manifest. No test covered the CLI before, so CI did not catch the crash.
   
   Fixes #296
   
   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   ## Summary
   
   <!-- Describe what this PR does and why. -->
   
   ## Related Issues
   
   <!-- Link any related GitHub issues: Closes #123, Fixes #456 -->
   
   ## 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
   
   ### 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


-- 
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(dbt): use pydantic v1 .json() in ossie-to-msi [ossie]

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


-- 
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(dbt): use pydantic v1 .json() in ossie-to-msi [ossie]

Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on PR #331:
URL: https://github.com/apache/ossie/pull/331#issuecomment-5647718662

   Thanks for the fix @ntoxlut. LGTM.


-- 
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(dbt): serialize osi-to-msi manifest with pydantic v1 .json() [ossie]

Posted by "MonkeyCanCode (via GitHub)" <gi...@apache.org>.
MonkeyCanCode commented on PR #331:
URL: https://github.com/apache/ossie/pull/331#issuecomment-5565216233

   Thanks for the PR @ntoxlut . The fix looks good to me, however, we need to change the naming in test where `osi` is now renamed to `ossie`. So the current test would fail on the main branch.


-- 
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(dbt): use pydantic v1 .json() in ossie-to-msi [ossie]

Posted by "ntoxlut (via GitHub)" <gi...@apache.org>.
ntoxlut commented on PR #331:
URL: https://github.com/apache/ossie/pull/331#issuecomment-5634492804

   Thanks @MonkeyCanCode, good catch. Rebased onto current `main` and renamed everything to match #288 — helpers are `_ossie_*` now, `to_ossie_yaml()`, and the subcommand is `ossie-to-msi`.
   
   The fix itself still applies: `cli.py` on `main` calls `.model_dump_json()` on `PydanticSemanticManifest`, which is a pydantic v1 model.
   
   `uv run pytest` passes (101), and reverting just the `cli.py` change makes the new test fail with the original `AttributeError`.


-- 
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