Skip to content

Add notification classification SCHEMA #1086

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/neo4j/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ class NotificationDisabledCategory(str, Enum):

.. versionchanged:: 5.14
Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`.

.. versionchanged:: 5.24
Added category :attr:`.SCHEMA`.
"""

HINT = "HINT"
Expand All @@ -167,6 +170,8 @@ class NotificationDisabledCategory(str, Enum):
SECURITY = "SECURITY"
#: Requires server version 5.13 or newer.
TOPOLOGY = "TOPOLOGY"
#: Requires server version 5.17 or newer.
SCHEMA = "SCHEMA"


class NotificationDisabledClassification(str, Enum):
Expand All @@ -188,6 +193,9 @@ class NotificationDisabledClassification(str, Enum):
:ref:`session-notifications-disabled-classifications-ref`

.. versionadded:: 5.22

.. versionchanged:: 5.24
Added classification :attr:`.SCHEMA`.
"""

HINT = "HINT"
Expand All @@ -199,6 +207,8 @@ class NotificationDisabledClassification(str, Enum):
SECURITY = "SECURITY"
#: Requires server version 5.13 or newer.
TOPOLOGY = "TOPOLOGY"
#: Requires server version 5.17 or newer.
SCHEMA = "SCHEMA"


if t.TYPE_CHECKING:
Expand All @@ -214,6 +224,7 @@ class NotificationDisabledClassification(str, Enum):
"GENERIC",
"SECURITY",
"TOPOLOGY",
"SCHEMA",
],
]
__all__.append("T_NotificationDisabledCategory")
Expand All @@ -239,6 +250,9 @@ class NotificationCategory(str, Enum):

.. versionchanged:: 5.14
Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`.

.. versionchanged:: 5.24
Added category :attr:`.SCHEMA`.
"""

HINT = "HINT"
Expand All @@ -249,6 +263,7 @@ class NotificationCategory(str, Enum):
GENERIC = "GENERIC"
SECURITY = "SECURITY"
TOPOLOGY = "TOPOLOGY"
SCHEMA = "SCHEMA"
#: Used when the server provides a Category which the driver is unaware of.
#: This can happen when connecting to a server newer than the driver or
#: before notification categories were introduced.
Expand All @@ -270,6 +285,9 @@ class NotificationClassification(str, Enum):
.. seealso:: :attr:`.GqlStatusObject.classification`

.. versionadded:: 5.22

.. versionchanged:: 5.24
Added classification :attr:`.SCHEMA`.
"""

HINT = "HINT"
Expand All @@ -280,6 +298,7 @@ class NotificationClassification(str, Enum):
GENERIC = "GENERIC"
SECURITY = "SECURITY"
TOPOLOGY = "TOPOLOGY"
SCHEMA = "SCHEMA"
#: Used when the server provides a Category which the driver is unaware of.
#: This can happen when connecting to a server newer than the driver or
#: before notification categories were introduced.
Expand Down
1 change: 1 addition & 0 deletions src/neo4j/_work/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def __str__(self) -> str:
"GENERIC": NotificationCategory.GENERIC,
"SECURITY": NotificationCategory.SECURITY,
"TOPOLOGY": NotificationCategory.TOPOLOGY,
"SCHEMA": NotificationCategory.SCHEMA,
}

_CLASSIFICATION_LOOKUP: t.Dict[t.Any, NotificationClassification] = {
Expand Down
1 change: 1 addition & 0 deletions tests/unit/common/work/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2164,6 +2164,7 @@ def _make_summary_notification(
("GENERIC", NotificationCategory.GENERIC),
("SECURITY", NotificationCategory.SECURITY),
("TOPOLOGY", NotificationCategory.TOPOLOGY),
("SCHEMA", NotificationCategory.SCHEMA),
)
),
*(
Expand Down