Skip to content

Commit ba80d91

Browse files
committed
Merge pull request #40 from pontusmelke/1.0-severity
Add severity to notifications
2 parents 1d39cee + 8f77897 commit ba80d91

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
@@ -282,7 +282,7 @@ def __init__(self, statement, parameters, **metadata):
282282
if position is not None:
283283
position = Position(position["offset"], position["line"], position["column"])
284284
self.notifications.append(Notification(notification["code"], notification["title"],
285-
notification["description"], position))
285+
notification["description"], notification["severity"], position))
286286

287287

288288
class Counters(object):
@@ -365,9 +365,11 @@ def __repr__(self):
365365
#: a short summary of the notification
366366
#: description:
367367
#: a long description of the notification
368+
#: severity:
369+
#: the severity level of the notification
368370
#: position:
369371
#: the position in the statement where this notification points to, if relevant.
370-
Notification = namedtuple("Notification", ("code", "title", "description", "position"))
372+
Notification = namedtuple("Notification", ("code", "title", "description", "severity", "position"))
371373

372374
#: A position within a statement, consisting of offset, line and column.
373375
#:

test/test_session.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ def test_can_obtain_notification_info(self):
311311
assert notification.code == "Neo.ClientNotification.Statement.CartesianProduct"
312312
assert notification.title == "This query builds a cartesian product between " \
313313
"disconnected patterns."
314+
assert notification.severity == "WARNING"
314315
assert notification.description == "If a part of a query contains multiple " \
315316
"disconnected patterns, this will build a " \
316317
"cartesian product between all those parts. This " \

0 commit comments

Comments
 (0)