diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java index 6d9db7a00eb8..22536b295339 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java @@ -1453,14 +1453,15 @@ protected void updateTags(String fqn, String fieldName, List origTags, return; // Nothing to update } - // Remove current entity tags in the database. It will be added back later from the merged tag list. - daoCollection.tagUsageDAO().deleteTagsByTarget(fqn); - if (operation.isPut()) { // PUT operation merges tags in the request with what already exists EntityUtil.mergeTags(updatedTags, origTags); + checkMutuallyExclusive(updatedTags); } + // Remove current entity tags in the database. It will be added back later from the merged tag list. + daoCollection.tagUsageDAO().deleteTagsByTarget(fqn); + List addedTags = new ArrayList<>(); List deletedTags = new ArrayList<>(); recordListChange(fieldName, origTags, updatedTags, addedTags, deletedTags, tagLabelMatch);