-
Notifications
You must be signed in to change notification settings - Fork 6
MLE-22784 Using just a UUID as a temporary URI #517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Using "/temporary/(UUID)" resulted in the "/temporary" being retained if no URI modification option was provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses an issue where temporary URIs were retaining the "/temporary" prefix when no URI modification option was provided. The fix changes the temporary URI generation from "/temporary/(UUID)" to just using the UUID directly.
- Modified temporary URI generation to use only UUID instead of "/temporary/(UUID)" prefix
- Added test coverage to verify URIs are UUIDs with .json extension and contain no forward slashes
- Updated comments to explain the logic duplication with StandardUriMaker
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
ArbitraryRowConverter.java | Changed temporary URI generation from "/temporary/(UUID)" to UUID only |
AddEmbeddingsToJsonTest.java | Added test to verify correct URI generation without URI modifier |
Comments suppressed due to low confidence (1)
tests/src/test/java/com/marklogic/spark/writer/embedding/AddEmbeddingsToJsonTest.java:365
- The test verifies that URIs don't contain forward slashes, but it doesn't validate that the URI is actually a valid UUID format. Consider adding a regex check or UUID.fromString() validation to ensure the URI is a properly formatted UUID.
assertFalse(uri.contains("/"), message);
// when constructing a DocumentWriteOperationImpl. This does duplicate a little bit of logic - | ||
// StandardUriMaker assumes the same default value for a URI. That is acceptable, though, as a UUID is a very | ||
// common way to generate a unique identifier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment mentions logic duplication but doesn't clearly explain why this duplication is acceptable or what the alternative would be. Consider clarifying the trade-offs or rationale more explicitly.
// when constructing a DocumentWriteOperationImpl. This does duplicate a little bit of logic - | |
// StandardUriMaker assumes the same default value for a URI. That is acceptable, though, as a UUID is a very | |
// common way to generate a unique identifier. | |
// when constructing a DocumentWriteOperationImpl. This logic duplicates the default URI generation | |
// approach used in StandardUriMaker, which also relies on a UUID. The duplication is intentional to | |
// ensure compatibility with the document pipeline and avoid introducing dependencies on StandardUriMaker | |
// in this class. Using a UUID is a widely accepted method for generating unique identifiers, and refactoring | |
// this logic would require changes to StandardUriMaker, which may not be desirable due to its broader usage. |
Copilot uses AI. Check for mistakes.
|
Using "/temporary/(UUID)" resulted in the "/temporary" being retained if no URI modification option was provided.