mchades commented on code in PR #13446:
URL: https://github.com/apache/gravitino/pull/13446#discussion_r4122028284


##########
core/src/test/java/org/apache/gravitino/utils/TestMetadataObjectUtil.java:
##########
@@ -325,6 +331,9 @@ public void 
testCheckMetadataObjectUsesInternalDispatchers() {
           "metalake", MetadataObjects.of(null, "job", 
MetadataObject.Type.JOB));
       MetadataObjectUtil.checkMetadataObject(
           "metalake", MetadataObjects.of(null, "template", 
MetadataObject.Type.JOB_TEMPLATE));
+      MetadataObjectUtil.checkMetadataObject(
+          "metalake",
+          MetadataObjects.of("catalog.schema", "sm", 
MetadataObject.Type.SEMANTIC_MODEL));

Review Comment:
   Please cover the reported behavior instead of only verifying the dispatcher 
call. `TagManager.SUPPORTED_METADATA_OBJECT_TYPES_FOR_TAGS` still omits 
`SEMANTIC_MODEL`, so tag association fails its precondition before reaching 
this method. `MetadataObjectService.TYPE_TO_FULLNAME_FUNCTION_MAP` also lacks 
this type, so listing associated objects cannot resolve it. Add the remaining 
governance plumbing and a TagManager or PolicyManager behavior test, or stop 
closing #13445 because its reproduction remains.



##########
core/src/main/java/org/apache/gravitino/utils/MetadataObjectUtil.java:
##########
@@ -347,6 +348,15 @@ public static void checkMetadataObject(String metalake, 
MetadataObject object) {
         }
         break;
 
+      case SEMANTIC_MODEL:
+        NameIdentifierUtil.checkSemanticModel(identifier);
+        try {
+          env.semanticModelDispatcher().loadSemanticModel(identifier);

Review Comment:
   Use `semanticModelExists(identifier)` here and pass its result to 
`check(...)`. The event dispatcher in #13458 emits load events from 
`loadSemanticModel()` but deliberately delegates `semanticModelExists()` 
without events. Calling `loadSemanticModel()` from this validation path would 
therefore emit a Semantic Model load event when tag, policy, or owner code only 
checks existence; the other object branches avoid those side effects through 
internal or existence dispatchers. #12867 already uses the side-effect-free 
form.



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