-
Notifications
You must be signed in to change notification settings - Fork 28
chore: add some tests validating urn logic #419
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
Draft
benbellick
wants to merge
3
commits into
main
Choose a base branch
from
add-urn-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Actually, I caught a small bug that allowed urns like
extension:one:two:three:four:five. Let me know if this is an okay implementation!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.
Where is it specified that this is an invalid 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.
You are right, it isn't specified anywhere. However, if we do use
extension:one:two:three:four:five, then there is an ambiguous parse. Any one of the following could be the owner for example:Since this isn't formally captured in the substrait docs, I have opened a PR in upstream here.
The behavior introduced in this PR is consistent with the implementations in other projects
For consistency with the other libraries, we could instead use a regex to validate? It would probably be slower, but what do you think?
I could also introduce the regex into the substrait upstream itself.
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.
I would suggest following https://en.wikipedia.org/wiki/Uniform_Resource_Name#Syntax
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.
Ah I think I see the distinction now. You raise a fair point. Perhaps the correct solution is actually to upstream to the parent substrait lib a clarification that
extension:owner:<something that may contain ':'>will always parse in the way you had it before as owner=owner, and id=<something that may contain ':'>.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.
Actually, we are already breaking from urn convention, as our "urns" do not have
urn:prepended to themI originally wrote about the
<NID>being invalid because it has periods, but I realize now that our<NID>is in factextension, so that part is fine.Shall we clarify then that for us, urns are valid "official" urns but just with the
urn:prefix chopped off?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.
Sounds good to me (this was also my understanding). Let's discuss and document this in the main repo.
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.
Reopened the PR in upstream with this clarification. Thanks!