Skip to content

Updates to annotation validation and validation test additions#3450

Open
drewfarris wants to merge 6 commits into
integrationfrom
feature/annotation-validation-update
Open

Updates to annotation validation and validation test additions#3450
drewfarris wants to merge 6 commits into
integrationfrom
feature/annotation-validation-update

Conversation

@drewfarris
Copy link
Copy Markdown
Collaborator

  • Now provides separate validators for checking annotation data vs. annotation identity, so that writes of unidentified annotations can be performend and validated prior to assigning ids.
  • Updates ingest tests to add segment hashes

@drewfarris drewfarris marked this pull request as ready for review March 3, 2026 21:58
@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch 2 times, most recently from 2d579d7 to 34b3d92 Compare March 26, 2026 14:39
@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch 2 times, most recently from 81c36e2 to 539f419 Compare March 31, 2026 15:34
@drewfarris drewfarris self-assigned this Mar 31, 2026
@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch from 539f419 to f95a2f0 Compare March 31, 2026 15:40
@drewfarris drewfarris changed the title Updates to annotation validation and adds validation tests Updates to annotation validation and validation test additions Mar 31, 2026
Comment thread core/annotation/src/main/java/datawave/annotation/util/v1/AnnotationUtils.java Outdated
Copy link
Copy Markdown
Collaborator

@FineAndDandy FineAndDandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few questions otherwise looks good

@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch from f95a2f0 to 94790a3 Compare April 10, 2026 19:16
@drewfarris drewfarris requested a review from FineAndDandy April 20, 2026 19:31
@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch 2 times, most recently from ee1537b to 23c8720 Compare April 20, 2026 20:43
Comment on lines +404 to +408
// If we get here, the delete handled empty results correctly
} catch (IllegalArgumentException e) {
// This is expected if mutationAdapter returns null and writer.addMutation is called with null
// The implementation should be fixed to check for null mutations
assertTrue(e.getMessage().contains("m is null"));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which case are you expecting here? The silent pass through or the catch on the IllegalArgumentException?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. I meant to modify the logic to throw an exception when the object to delete is not found - matching the semantics for an update operation.

@drewfarris drewfarris requested a review from FineAndDandy April 22, 2026 11:14
FineAndDandy
FineAndDandy previously approved these changes Apr 22, 2026
@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch 2 times, most recently from 93ffedd to 85d12ee Compare April 30, 2026 19:59
if (blockAnnotationOverwrites) {
throw new AnnotationWriteException("Cannot add annotation because an annotation with the same id already exists.");
} else {
log.debug("Allowing annotation overwrite: {}", annotationIdContext(conflicting.get()));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar note here if applicable

* Now provides separate validators for checking annotation data vs. annotation identity, so that writes of unidentified annotations can be performend and validated prior to assigning ids.
* Updates ingest tests to add segment hashes
* Demonstrates that empty source is provided if no source is specified in the Annotation builder.
* Demonstrates that the builder won't accept null and thus the validations don't need to explicitly check for null.
@drewfarris drewfarris force-pushed the feature/annotation-validation-update branch from 85d12ee to b274cb8 Compare May 11, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants