Skip to content

Commit 971dc9d

Browse files
authored
Amend notification APIs deprecation in favor of GQL status APIs (#1240)
This PR fixes some docs that were missed in #1209
1 parent abc6bff commit 971dc9d

File tree

4 files changed

+39
-28
lines changed

4 files changed

+39
-28
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
183183
- `neo4j.SummaryNotification`
184184
- `neo4j.NotificationCategory`
185185
- `neo4j.NotificationDisabledCategory`
186+
- `notifications_disabled_categories` driver and session configuration option
187+
in favor of `notifications_disabled_classifications`
186188
- Stabilize GQL status objects (use this instead of notifications):
187189
- `ResultSummary.gql_status_objects`
188190
- `neo4j.GqlStatusObject`

src/neo4j/_api.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ class NotificationDisabledCategory(str, Enum):
272272
273273
.. versionchanged:: 5.24
274274
Added category :attr:`.SCHEMA`.
275+
276+
.. deprecated:: 6.0
277+
Use :class:`.NotificationDisabledClassification` instead.
275278
"""
276279

277280
HINT = "HINT"
@@ -294,12 +297,6 @@ class NotificationDisabledClassification(str, Enum):
294297
This alternative is provided for a consistent naming with
295298
:attr:`.GqlStatusObject.classification`.
296299
297-
**This is a preview**.
298-
It might be changed without following the deprecation policy.
299-
300-
See also
301-
https://github.com/neo4j/neo4j-python-driver/wiki/preview-features
302-
303300
.. seealso::
304301
driver config
305302
:ref:`driver-notifications-disabled-classifications-ref`,
@@ -310,6 +307,8 @@ class NotificationDisabledClassification(str, Enum):
310307
311308
.. versionchanged:: 5.24
312309
Added classification :attr:`.SCHEMA`.
310+
311+
.. versionchanged:: 6.0 Stabilized from preview.
313312
"""
314313

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

327326

328327
if t.TYPE_CHECKING:
329-
T_NotificationDisabledCategory = (
328+
T_NotificationDisabledClassification = (
330329
NotificationDisabledCategory
331330
| NotificationDisabledClassification
332331
| t.Literal[
@@ -341,7 +340,7 @@ class NotificationDisabledClassification(str, Enum):
341340
"SCHEMA",
342341
]
343342
)
344-
__all__.append("T_NotificationDisabledCategory")
343+
__all__.append("T_NotificationDisabledClassification")
345344

346345

347346
class NotificationCategory(str, Enum):

src/neo4j/_async/driver.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
from enum import Enum
9797

9898
from .._api import (
99-
T_NotificationDisabledCategory,
99+
T_NotificationDisabledClassification,
100100
T_NotificationMinimumSeverity,
101101
T_RoutingControl,
102102
)
@@ -143,11 +143,12 @@ def driver(
143143
notifications_min_severity: (
144144
T_NotificationMinimumSeverity | None
145145
) = ...,
146+
# deprecated in favor of notifications_disabled_classifications
146147
notifications_disabled_categories: (
147-
t.Iterable[T_NotificationDisabledCategory] | None
148+
t.Iterable[T_NotificationDisabledClassification] | None
148149
) = ...,
149150
notifications_disabled_classifications: (
150-
t.Iterable[T_NotificationDisabledCategory] | None
151+
t.Iterable[T_NotificationDisabledClassification] | None
151152
) = ...,
152153
warn_notification_severity: (
153154
T_NotificationMinimumSeverity | None
@@ -542,11 +543,12 @@ def session(
542543
notifications_min_severity: (
543544
T_NotificationMinimumSeverity | None
544545
) = ...,
546+
# deprecated in favor of notifications_disabled_classifications
545547
notifications_disabled_categories: (
546-
t.Iterable[T_NotificationDisabledCategory] | None
548+
t.Iterable[T_NotificationDisabledClassification] | None
547549
) = ...,
548550
notifications_disabled_classifications: (
549-
t.Iterable[T_NotificationDisabledCategory] | None
551+
t.Iterable[T_NotificationDisabledClassification] | None
550552
) = ...,
551553
# undocumented/unsupported options
552554
# they may be change or removed any time without prior notice
@@ -572,7 +574,10 @@ def session(self, **config) -> AsyncSession:
572574
:raises DriverError: if the driver has been closed.
573575
574576
.. versionchanged:: 6.0
575-
Raise :exc:`DriverError` if the driver has been closed.
577+
578+
* Raise :exc:`DriverError` if the driver has been closed.
579+
* Deprecated ``notifications_disabled_categories`` in favor of
580+
``notifications_disabled_classifications``.
576581
"""
577582
# Would work just fine, but we don't want to introduce yet
578583
# another undocumented/unsupported config option.
@@ -1001,10 +1006,10 @@ async def verify_connectivity(
10011006
T_NotificationMinimumSeverity | None
10021007
) = ...,
10031008
notifications_disabled_categories: (
1004-
t.Iterable[T_NotificationDisabledCategory] | None
1009+
t.Iterable[T_NotificationDisabledClassification] | None
10051010
) = ...,
10061011
notifications_disabled_classifications: (
1007-
t.Iterable[T_NotificationDisabledCategory] | None
1012+
t.Iterable[T_NotificationDisabledClassification] | None
10081013
) = ...,
10091014
# undocumented/unsupported options
10101015
initial_retry_delay: float = ...,
@@ -1078,10 +1083,10 @@ async def get_server_info(
10781083
T_NotificationMinimumSeverity | None
10791084
) = ...,
10801085
notifications_disabled_categories: (
1081-
t.Iterable[T_NotificationDisabledCategory] | None
1086+
t.Iterable[T_NotificationDisabledClassification] | None
10821087
) = ...,
10831088
notifications_disabled_classifications: (
1084-
t.Iterable[T_NotificationDisabledCategory] | None
1089+
t.Iterable[T_NotificationDisabledClassification] | None
10851090
) = ...,
10861091
# undocumented/unsupported options
10871092
initial_retry_delay: float = ...,

src/neo4j/_sync/driver.py

Lines changed: 15 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)