Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
- `neo4j.SummaryNotification`
- `neo4j.NotificationCategory`
- `neo4j.NotificationDisabledCategory`
- `notifications_disabled_categories` driver and session configuration option
in favor of `notifications_disabled_classifications`
- Stabilize GQL status objects (use this instead of notifications):
- `ResultSummary.gql_status_objects`
- `neo4j.GqlStatusObject`
Expand Down
15 changes: 7 additions & 8 deletions src/neo4j/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ class NotificationDisabledCategory(str, Enum):

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

.. deprecated:: 6.0
Use :class:`.NotificationDisabledClassification` instead.
"""

HINT = "HINT"
Expand All @@ -294,12 +297,6 @@ class NotificationDisabledClassification(str, Enum):
This alternative is provided for a consistent naming with
:attr:`.GqlStatusObject.classification`.

**This is a preview**.
It might be changed without following the deprecation policy.

See also
https://github.com/neo4j/neo4j-python-driver/wiki/preview-features

.. seealso::
driver config
:ref:`driver-notifications-disabled-classifications-ref`,
Expand All @@ -310,6 +307,8 @@ class NotificationDisabledClassification(str, Enum):

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

.. versionchanged:: 6.0 Stabilized from preview.
"""

HINT = "HINT"
Expand All @@ -326,7 +325,7 @@ class NotificationDisabledClassification(str, Enum):


if t.TYPE_CHECKING:
T_NotificationDisabledCategory = (
T_NotificationDisabledClassification = (
NotificationDisabledCategory
| NotificationDisabledClassification
| t.Literal[
Expand All @@ -341,7 +340,7 @@ class NotificationDisabledClassification(str, Enum):
"SCHEMA",
]
)
__all__.append("T_NotificationDisabledCategory")
__all__.append("T_NotificationDisabledClassification")


class NotificationCategory(str, Enum):
Expand Down
25 changes: 15 additions & 10 deletions src/neo4j/_async/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
from enum import Enum

from .._api import (
T_NotificationDisabledCategory,
T_NotificationDisabledClassification,
T_NotificationMinimumSeverity,
T_RoutingControl,
)
Expand Down Expand Up @@ -143,11 +143,12 @@ def driver(
notifications_min_severity: (
T_NotificationMinimumSeverity | None
) = ...,
# deprecated in favor of notifications_disabled_classifications
notifications_disabled_categories: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
notifications_disabled_classifications: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
warn_notification_severity: (
T_NotificationMinimumSeverity | None
Expand Down Expand Up @@ -542,11 +543,12 @@ def session(
notifications_min_severity: (
T_NotificationMinimumSeverity | None
) = ...,
# deprecated in favor of notifications_disabled_classifications
notifications_disabled_categories: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
notifications_disabled_classifications: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
# undocumented/unsupported options
# they may be change or removed any time without prior notice
Expand All @@ -572,7 +574,10 @@ def session(self, **config) -> AsyncSession:
:raises DriverError: if the driver has been closed.

.. versionchanged:: 6.0
Raise :exc:`DriverError` if the driver has been closed.

* Raise :exc:`DriverError` if the driver has been closed.
* Deprecated ``notifications_disabled_categories`` in favor of
``notifications_disabled_classifications``.
"""
# Would work just fine, but we don't want to introduce yet
# another undocumented/unsupported config option.
Expand Down Expand Up @@ -1001,10 +1006,10 @@ async def verify_connectivity(
T_NotificationMinimumSeverity | None
) = ...,
notifications_disabled_categories: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
notifications_disabled_classifications: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
# undocumented/unsupported options
initial_retry_delay: float = ...,
Expand Down Expand Up @@ -1078,10 +1083,10 @@ async def get_server_info(
T_NotificationMinimumSeverity | None
) = ...,
notifications_disabled_categories: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
notifications_disabled_classifications: (
t.Iterable[T_NotificationDisabledCategory] | None
t.Iterable[T_NotificationDisabledClassification] | None
) = ...,
# undocumented/unsupported options
initial_retry_delay: float = ...,
Expand Down
25 changes: 15 additions & 10 deletions src/neo4j/_sync/driver.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.