@@ -172,20 +172,23 @@ def test_result_summary_query_profile(self):
172172 driver = GraphDatabase .driver ("bolt://localhost" )
173173 session = driver .session ()
174174 # 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}}) "
176176 "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 )
180181 # end::result-summary-query-profile[]
181182 session .close ()
182183
183184 def test_result_summary_notifications (self ):
184185 driver = GraphDatabase .driver ("bolt://localhost" )
185186 session = driver .session ()
186187 # 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 :
189192 print (notification )
190193 # end::result-summary-notifications[]
191194 session .close ()
0 commit comments