-
Notifications
You must be signed in to change notification settings - Fork 199
ADR 022: GQL compliant notifications #1060
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
Merged
Merged
Conversation
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
* make severity and classification optional for both parsed and raw values * Only fill in parts of the diagnostic record if missing or invalid
Only raw severity and classification are optional
bigmontz
requested changes
Jun 14, 2024
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.
the version is wrong and there are some leftovers
Co-authored-by: Antonio Barcélos <[email protected]>
Co-authored-by: Antonio Barcélos <[email protected]>
Co-authored-by: Antonio Barcélos <[email protected]>
bigmontz
approved these changes
Jun 14, 2024
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.
🛎️
Does GQL require an api with "GQL" in all the names? |
robsdedude
added a commit
to robsdedude/neo4j-python-driver
that referenced
this pull request
Sep 18, 2024
When introducing bolt 5.5 support for GQL statuses in the summary, the driver gained the ability to polyfill old-style notifications from the statuses. However, `ResultSummary.notifications` used to be `None` when the server didn't send any notifications. When using the polyfill, the field would be set to `[]` instead in the same scenario. This PR fixes this.
robsdedude
added a commit
that referenced
this pull request
Sep 19, 2024
…tions-polyfill Revert breaking change in summary.notification introduced in #1060
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GQL Summary Statuses
This PR introduces GQL compliant status objects to the
ResultSummary
.It might be changed without following the deprecation policy.
Deprecations
SummaryNotificationPosition
has been deprecated in favor ofSummaryInputPosition
.New GQL Status Objects
A new property
ResultSummary.gql_status_objects
has been introduced. It returns a sequence ofGqlStatusObject
s. These objects contain information about the execution of the query including notifications as they exist now (seeSummaryNotification
) but also an outcome status like00000
for "success",02000
for "no data", and00001
for "omitted result".Eventually, this API is planned to supersede the current notifications API.
The GqlStatusObjects will be presented in the following order:
02xxx
) has precedence over a warning;01xxx
) has precedence over a success.00xxx
) has precedence over anything informational (03xxx
).Notification Filtering
Some status objects are notifications (vendor-specific definition). Those notifications can be identified using
GqlStatusObject.is_notification
. They contain additional information like aclassification
,severity
, andposition
. Further, those notifications can be configured to be suppressed in the DBMS saving bandwidth not having to send them to the client as well as compute not having to check for those conditions.For this, the following driver config options can be used:
notifications_min_severity
(already existing)notifications_disabled_classifications
(new, same as the existingnotifications_disabled_categories
).If both options are provided, they are merged into a single list of disabled classifications/categories.
All filter config options will affect both the current notifications API as well as the notifications among the GQL status objects.
Polyfilling
There are now two APIs to access notifications: the old notifications API and the new GQL status API. To provide an easy migration path the driver will, depending on if the server is GQL aware or not (i.e., recent or old neo4j version), polyfill the API not supported by the server on a best-effort basis. In particular, GQL status objects have a GQLSTATUS code that has not counterpart in non-GQL-aware neo4j versions. Therefore, the driver will fill the GQLSTATUS with either
01N42
for warning notifications and03N42
for informational notifications. Further, such status codes might be used by the server in the transition phase towards full GQL compliance. They indicate a lack of a final status code and will likely change in the future.A list of all possible GQLSTATUS codes is not yet available as the server-side of this change is still very actively being worked on.
Example Usage
Which, when run against an empty 5.19 DBMS, gives the following output
Depends on: