laserninja opened a new pull request, #12858:
URL: https://github.com/apache/gravitino/pull/12858

   ### What changes were proposed in this pull request?
   
   This PR adds the public Python API for Semantic Models, mirroring the Java 
`org.apache.gravitino.semantic` package added in #12498:
   
   - Ossie-compatible value types: `AIContext`, `AIContextObject`, 
`CustomExtension`, `DataType`, `Dialects`, `DialectExpression`, `Expression`, 
`Dimension`, `Field`, `Dataset`, `Metric`, and `Relationship`.
   - `SemanticModelDefinition`, the `SemanticModel` and `SemanticModelCatalog` 
contracts, and `SemanticModelChange` with its five supported operations.
   - `NoSuchSemanticModelException`, `SemanticModelAlreadyExistsException`, and 
`IllegalSemanticModelException`.
   - `Catalog.as_semantic_model_catalog()`, which raises 
`UnsupportedOperationException` by default.
   
   Validation mirrors the Java builders, including dialect uniqueness within an 
expression, equal-length and non-empty relationship column lists, and the 
JSON-compatibility, nesting-depth, and cycle checks applied to AI-context 
additional properties. Values are defensively copied on construction and on 
read so instances stay immutable.
   
   `Relationship` exposes `from_dataset()` and `to_dataset()` because `from` is 
a reserved word in Python. The Ossie `from` and `to` names are preserved on the 
wire by the DTO layer.
   
   DTO serialization and REST client operations are out of scope and are 
handled in #12613 and #12614.
   
   ### Why are the changes needed?
   
   The Python client has no Semantic Model support today, so Python users 
cannot manage the Semantic Models introduced by the epic. This is the first of 
three sub-tasks that add that support.
   
   Fix: #12612
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. It adds the public `gravitino.api.semantic` package and 
`Catalog.as_semantic_model_catalog()`. The change is purely additive; no 
existing API changes behavior.
   
   ### How was this patch tested?
   
   Added 51 unit tests across five new test modules covering the supporting 
types, model members, definition, changes, and the catalog contract. They 
assert defaults, equality and hashing, defensive copying, and every validation 
failure path.
   
   ```
   ./gradlew :clients:client-python:test
   ```
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to