@@ -172,20 +172,23 @@ def test_result_summary_query_profile(self):
172
172
driver = GraphDatabase .driver ("bolt://localhost" )
173
173
session = driver .session ()
174
174
# tag::result-summary-query-profile[]
175
- cursor = session .run ("PROFILE MATCH (p:Person {name: {name}}) "
175
+ result = session .run ("PROFILE MATCH (p:Person {name: {name}}) "
176
176
"RETURN id(p)" , {"name" : "The One" })
177
- summary = cursor .summary ()
178
- print (summary .statement_type )
179
- print (summary .profile )
177
+ while result .next ():
178
+ pass # skip the records to get to the summary
179
+ print (result .summary .statement_type )
180
+ print (result .summary .profile )
180
181
# end::result-summary-query-profile[]
181
182
session .close ()
182
183
183
184
def test_result_summary_notifications (self ):
184
185
driver = GraphDatabase .driver ("bolt://localhost" )
185
186
session = driver .session ()
186
187
# tag::result-summary-notifications[]
187
- summary = session .run ("EXPLAIN MATCH (a), (b) RETURN a,b" ).summary ()
188
- for notification in summary .notifications :
188
+ result = session .run ("EXPLAIN MATCH (a), (b) RETURN a,b" )
189
+ while result .next ():
190
+ pass # skip the records to get to the summary
191
+ for notification in result .summary .notifications :
189
192
print (notification )
190
193
# end::result-summary-notifications[]
191
194
session .close ()
0 commit comments