This repository has been archived by the owner on Aug 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 266
ensure that rooted Sets and Lists don't have keys #3684
Open
wardn
wants to merge
1
commit into
attic-labs:master
Choose a base branch
from
wardn:rootcollections
base: master
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.
Open
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 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.
Two things:
keys
but the thing at that level is a set or list, that should be an error. So it seems like the fix should be somewhere lower down.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.
PS: Thanks for the patch!
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.
Seems like sometimes you want a key pointing to a set/list... like if you have a base map that has a nested set/list. (see types/graph_builder_test.go:ExampleGraphBuilder_Build()). But it's definitely a problem if the base type isn't a map since the base collection isn't nested.
I would've liked to have handled it deeper, but once it's been put into ldb it's hard to tell where it's at until everything is unwound through graphbuilder.Build().
I'm not married to the solution... just wanted to communicate the problem and suggest a workaround until I get better acquainted with the code.
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.
Consider a case like this (psuedocode):
This is another example of trying to set a key ("bar") in a list. It's just further down in the tree. How do we handle this currently? Or do we not. If not, perhaps we can handle the two problems in the same way.
If we can't handle it until build that might be OK so that all error cases are handled in a consistent way.