Skip to content

Commit 8f77897

Browse files
committed
Add severity to notifications
1 parent eff9108 commit 8f77897

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

neo4j/v1/session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def __init__(self, statement, parameters, **metadata):
333333
if position is not None:
334334
position = Position(position["offset"], position["line"], position["column"])
335335
self.notifications.append(Notification(notification["code"], notification["title"],
336-
notification["description"], position))
336+
notification["description"], notification["severity"], position))
337337

338338

339339
class Counters(object):
@@ -416,9 +416,11 @@ def __repr__(self):
416416
#: a short summary of the notification
417417
#: description:
418418
#: a long description of the notification
419+
#: severity:
420+
#: the severity level of the notification
419421
#: position:
420422
#: the position in the statement where this notification points to, if relevant.
421-
Notification = namedtuple("Notification", ("code", "title", "description", "position"))
423+
Notification = namedtuple("Notification", ("code", "title", "description", "severity", "position"))
422424

423425
#: A position within a statement, consisting of offset, line and column.
424426
#:

test/test_session.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def test_can_obtain_notification_info(self):
337337
assert notification.code == "Neo.ClientNotification.Statement.CartesianProduct"
338338
assert notification.title == "This query builds a cartesian product between " \
339339
"disconnected patterns."
340+
assert notification.severity == "WARNING"
340341
assert notification.description == "If a part of a query contains multiple " \
341342
"disconnected patterns, this will build a " \
342343
"cartesian product between all those parts. This " \

0 commit comments

Comments
 (0)