- 
                Notifications
    You must be signed in to change notification settings 
- Fork 35
Errors for Graph Type #341
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
base: dev
Are you sure you want to change the base?
Conversation
85e42a1    to
    d27c275      
    Compare
  
    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 haven't looked at the implementation PR but I did have some thoughts on the error messages from just looking at them in isolation.
Status: 0 open comment in this group and 1 in the next
| ---- | ||
| ALTER CURRENT GRAPH TYPE SET { | ||
| (p:Person => {name :: STRING}), | ||
| CONSTRAINT FOR (p:Person =>) REQUIRE p.name IS NOT NULL, | 
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.
do we want a second example where the node elem type and constraint have different properties (to show that it's not only a problem when the properties are the same)
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 don't think we need to, if somebody is looking at this page, they already have the error.
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.
maybe, but I just felt that since both the node and the relationship example had the same property it might be nice to also show some other cases that would fail
ALTER CURRENT GRAPH TYPE SET {
    (p:Person => {name :: STRING}),
    CONSTRAINT FOR (p:Person) REQUIRE p.ssn IS NOT NULL
}
Fix to:
ALTER CURRENT GRAPH TYPE SET {
    (p:Person => {name :: STRING, ssn:: ANY NOT NULL})
}
(this both have another property and doesn't say we expect the label to be identifying in the constraint 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.
I don't think we need any more examples, most of the error codes do not have any.
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.
yeah, cause they didn't have time to add any when doing the initial docs, they want there to be examples for all codes (I've been asked to add examples when I updated codes previously) so that's not really a metric to go after
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.
but if you don't want new/additional example then update the existing one instead: I just want some more variation in the examples and not have the very same case in both the node and relationship version (just switching which constraint type is where)
7d5bab3    to
    e25ea42      
    Compare
  
    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.
New round of comments
Status: only open comments are from the groups above
| ---- | ||
| ALTER CURRENT GRAPH TYPE SET { | ||
| (p:Person => {name :: STRING}), | ||
| CONSTRAINT FOR (p:Person =>) REQUIRE p.name IS NOT NULL, | 
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.
maybe, but I just felt that since both the node and the relationship example had the same property it might be nice to also show some other cases that would fail
ALTER CURRENT GRAPH TYPE SET {
    (p:Person => {name :: STRING}),
    CONSTRAINT FOR (p:Person) REQUIRE p.ssn IS NOT NULL
}
Fix to:
ALTER CURRENT GRAPH TYPE SET {
    (p:Person => {name :: STRING, ssn:: ANY NOT NULL})
}
(this both have another property and doesn't say we expect the label to be identifying in the constraint 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.
Many editorial comments, some of which require fixing the description in the codebase. When these are addressed, I'll build it locally and read it again. I also need to regenerate the index file to add the new codes.
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.
Looks good. A few minor comments.
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.
Noticed when double checking the messages and the impl updates
0ed16b5    to
    0098fca      
    Compare
  
    0098fca    to
    c8ec980      
    Compare
  
    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.
Review of new errors (and a brief look through the old)
Status: two open comments
| [source,cypher] | ||
| ---- | ||
| ALTER CURRENT GRAPH TYPE ALTER { | ||
| CONSTRAINT c1 FOR (s:Student) REQUIRE s.studentId :: STRING | 
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.
Since Gowri have (multiple times) stumbled on the inline key constraints it might be nice with an example of that as well
Given
ALTER CURRENT GRAPH TYPE SET {
    (:Label => :ToBeRemoved {prop :: STRING IS KEY})
}
Then:
ALTER CURRENT GRAPH TYPE ALTER {
    (:Label => {prop :: STRING IS KEY})
}
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 see that you have it for DROP, but I think Gowri have had more questions on it for ALTER 🤷
| } | ||
| ALTER CURRENT GRAPH TYPE ADD { | 
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.
would we need some indication that these are two queries and not one containing two alter clauses? 🤔 (since this would fail parsing on the second ALTER I'd assume)
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.
How is this normally done?
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 guess either separating them into two code blocks or having ; after them, but I'd double check how the docs team would want it
Co-authored-by: Therese Magnusson <[email protected]>
Co-authored-by: Therese Magnusson <[email protected]>
2f73662    to
    4cea064      
    Compare
  
    4cea064    to
    f2ada6a      
    Compare
  
    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.
Next group of comments
Co-authored-by: Therese Magnusson <[email protected]>
| @renetapopova I've updated this with the remaining set of error codes, and there is a couple of outstanding questions for docs. | 
| 
 I'll take a look next week. | 
| Is this PR for 2025.10? | 
| @renetapopova No, I don't think this is ready for release yet. | 
| } | ||
| ---- | ||
|  | ||
| === Remove a KEY constraint using ALTER | 
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 think you're adding and not removing a KEY constraint 🤔
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.
This file is autogenerated. You don't need to update it.
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 added some suggestions and a placeholder for the version.
Co-authored-by: Reneta Popova <[email protected]> Co-authored-by: Therese Magnusson <[email protected]>
Co-authored-by: Therese Magnusson <[email protected]>
Error codes for graph types.
This work is likely to be feature flagged for some time, so we don't want to merge it to the public docs yet, but we do need to review the errors.