From 2d331dac4138de896e0fd23d105dba97957c7ce9 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Mon, 24 Feb 2020 14:48:47 +0100 Subject: [PATCH 1/8] renamed class BoltStatementResult to Result --- docs/source/results.rst | 6 +++--- docs/source/types/graph.rst | 2 +- neo4j/work/simple.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/results.rst b/docs/source/results.rst index da61fd4cf..45ba0f857 100644 --- a/docs/source/results.rst +++ b/docs/source/results.rst @@ -2,14 +2,14 @@ Consuming Results ***************** -Every time Cypher is executed, a :class:`.BoltStatementResult` is returned. +Every time Cypher is executed, a :class:`neo4j.Result` is returned. This provides a handle to the result of the query, giving access to the records within it as well as the result metadata. Each result consists of header metadata, zero or more :class:`.Record` objects and footer metadata (the summary). Results also contain a buffer that automatically stores unconsumed records when results are consumed out of order. -A :class:`.BoltStatementResult` is attached to an active connection, through a :class:`.Session`, until all its content has been buffered or consumed. +A :class:`neo4j.Result` is attached to an active connection, through a :class:`.Session`, until all its content has been buffered or consumed. -.. class:: neo4j.BoltStatementResult +.. class:: neo4j.Result .. describe:: iter(result) diff --git a/docs/source/types/graph.rst b/docs/source/types/graph.rst index b7e7ec22a..f2a11a82b 100644 --- a/docs/source/types/graph.rst +++ b/docs/source/types/graph.rst @@ -21,7 +21,7 @@ Path :class:`.Path` .. class:: neo4j.types.graph.Graph A local, self-contained graph object that acts as a container for :class:`.Node` and :class:`.Relationship` instances. - This is typically obtained via the :meth:`.BoltStatementResult.graph` method. + This is typically obtained via the :meth:`neo4j.Result.graph` method. .. autoattribute:: nodes diff --git a/neo4j/work/simple.py b/neo4j/work/simple.py index 69e4ec433..da13b4cb9 100644 --- a/neo4j/work/simple.py +++ b/neo4j/work/simple.py @@ -193,7 +193,7 @@ def done(summary_metadata): self._bookmarks_in = tuple([bookmark]) self._bookmark_out = bookmark - self._last_result = result = BoltStatementResult(self, hydrant, result_metadata) + self._last_result = result = Result(self, hydrant, result_metadata) if has_transaction: if statement_metadata: @@ -595,7 +595,7 @@ def __str__(self): return str(self.text) -class BoltStatementResult: +class Result: """ A handler for the result of Cypher statement execution. Instances of this class are typically constructed and returned by :meth:`.Session.run` and :meth:`.Transaction.run`. From 49ef7c5fa1f2d73e8ab811b0ef6c97cc5fef326f Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Mon, 24 Feb 2020 15:02:48 +0100 Subject: [PATCH 2/8] renamed class BoltStatementResultSummary to ResultSummary --- docs/source/results.rst | 2 +- neo4j/work/simple.py | 16 ++++++++-------- neo4j/work/summary.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/source/results.rst b/docs/source/results.rst index 45ba0f857..a3341887c 100644 --- a/docs/source/results.rst +++ b/docs/source/results.rst @@ -103,7 +103,7 @@ A :class:`neo4j.Result` is attached to an active connection, through a :class:`. Summary Details --------------- -.. autoclass:: neo4j.BoltStatementResultSummary +.. autoclass:: neo4j.ResultSummary :members: .. autoclass:: neo4j.SummaryCounters diff --git a/neo4j/work/simple.py b/neo4j/work/simple.py index da13b4cb9..87f2570c5 100644 --- a/neo4j/work/simple.py +++ b/neo4j/work/simple.py @@ -37,7 +37,7 @@ ) from neo4j._exceptions import BoltIncompleteCommitError from neo4j.work import Workspace, WorkspaceConfig -from neo4j.work.summary import BoltStatementResultSummary +from neo4j.work.summary import ResultSummary log = getLogger("neo4j") @@ -132,11 +132,11 @@ def run(self, cypher, parameters=None, **kwparameters): """ Run a Cypher statement within an auto-commit transaction. The statement is sent and the result header received - immediately but the :class:`.StatementResult` content is + immediately but the :class:`neo4j.Result` content is fetched lazily as consumed by the client application. If a statement is executed before a previous - :class:`.StatementResult` in the same :class:`.Session` has + :class:`neo4j.Result` in the same :class:`.Session` has been fully consumed, the first result will be fully fetched and buffered. Note therefore that the generally recommended pattern of usage is to fully consume one result before @@ -149,7 +149,7 @@ def run(self, cypher, parameters=None, **kwparameters): :param cypher: Cypher statement :param parameters: dictionary of parameters :param kwparameters: additional keyword parameters - :returns: :class:`.StatementResult` object + :returns: :class:`neo4j.Result` object """ if not cypher: raise ValueError("Cannot run an empty statement") @@ -514,7 +514,7 @@ def run(self, statement, parameters=None, **kwparameters): :param statement: template Cypher statement :param parameters: dictionary of parameters :param kwparameters: additional keyword parameters - :returns: :class:`.StatementResult` object + :returns: :class:`neo4j.Result` object :raise TransactionError: if the transaction is closed """ self._assert_open() @@ -668,17 +668,17 @@ def records(self): def summary(self): """ Obtain the summary of this result, buffering any remaining records. - :returns: The :class:`.ResultSummary` for this result + :returns: The :class:`neo4j.ResultSummary` for this result """ self.detach() if self._summary is None: - self._summary = BoltStatementResultSummary(**self._metadata) + self._summary = ResultSummary(**self._metadata) return self._summary def consume(self): """ Consume the remainder of this result and return the summary. - :returns: The :class:`.ResultSummary` for this result + :returns: The :class:`neo4j.ResultSummary` for this result """ if self.attached(): for _ in self: diff --git a/neo4j/work/summary.py b/neo4j/work/summary.py index a32aad656..fac0032fc 100644 --- a/neo4j/work/summary.py +++ b/neo4j/work/summary.py @@ -27,8 +27,8 @@ BOLT_VERSION_4 = 4 -class BoltStatementResultSummary: - """ A summary of execution returned with a :class:`.StatementResult` object. +class ResultSummary: + """ A summary of execution returned with a :class:`.Result` object. """ #: The version of Bolt protocol over which this result was obtained. From 1f90a6594273c1d7ccaccd48abdda2d3d62d8847 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Mon, 24 Feb 2020 18:03:12 +0100 Subject: [PATCH 3/8] renamed statement argument to query --- neo4j/io/_bolt3.py | 6 +++--- neo4j/io/_bolt4x0.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/neo4j/io/_bolt3.py b/neo4j/io/_bolt3.py index dd2b54ba2..5d86c06c1 100644 --- a/neo4j/io/_bolt3.py +++ b/neo4j/io/_bolt3.py @@ -144,7 +144,7 @@ def hello(self): self.send_all() self.fetch_all() - def run(self, statement, parameters=None, mode=None, bookmarks=None, metadata=None, + def run(self, query, parameters=None, mode=None, bookmarks=None, metadata=None, timeout=None, db=None, **handlers): if db is not None: raise ValueError("Database selection is not supported in Bolt 3") @@ -168,9 +168,9 @@ def run(self, statement, parameters=None, mode=None, bookmarks=None, metadata=No extra["tx_timeout"] = int(1000 * timeout) except TypeError: raise TypeError("Timeout must be specified as a number of seconds") - fields = (statement, parameters, extra) + fields = (query, parameters, extra) log.debug("[#%04X] C: RUN %s", self.local_port, " ".join(map(repr, fields))) - if statement.upper() == u"COMMIT": + if query.upper() == u"COMMIT": self._append(b"\x10", fields, CommitResponse(self, **handlers)) else: self._append(b"\x10", fields, Response(self, **handlers)) diff --git a/neo4j/io/_bolt4x0.py b/neo4j/io/_bolt4x0.py index 3b444c41f..cf8aa8dca 100644 --- a/neo4j/io/_bolt4x0.py +++ b/neo4j/io/_bolt4x0.py @@ -144,7 +144,7 @@ def hello(self): self.send_all() self.fetch_all() - def run(self, statement, parameters=None, mode=None, bookmarks=None, metadata=None, + def run(self, query, parameters=None, mode=None, bookmarks=None, metadata=None, timeout=None, db=None, **handlers): if not parameters: parameters = {} @@ -168,9 +168,9 @@ def run(self, statement, parameters=None, mode=None, bookmarks=None, metadata=No extra["tx_timeout"] = int(1000 * timeout) except TypeError: raise TypeError("Timeout must be specified as a number of seconds") - fields = (statement, parameters, extra) + fields = (query, parameters, extra) log.debug("[#%04X] C: RUN %s", self.local_port, " ".join(map(repr, fields))) - if statement.upper() == u"COMMIT": + if query.upper() == u"COMMIT": self._append(b"\x10", fields, CommitResponse(self, **handlers)) else: self._append(b"\x10", fields, Response(self, **handlers)) From 2c621422e6ebde57b47274132d9f1ce74d0e5a96 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 25 Feb 2020 10:05:28 +0100 Subject: [PATCH 4/8] Renamed class Statement to Query --- neo4j/work/simple.py | 9 +++++++-- .../examples/test_autocommit_transaction_example.py | 4 ++-- tests/integration/test_autocommit.py | 10 +++++----- tests/integration/test_explicit_tx.py | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/neo4j/work/simple.py b/neo4j/work/simple.py index 87f2570c5..bb743fb24 100644 --- a/neo4j/work/simple.py +++ b/neo4j/work/simple.py @@ -153,7 +153,7 @@ def run(self, cypher, parameters=None, **kwparameters): """ if not cypher: raise ValueError("Cannot run an empty statement") - if not isinstance(cypher, (str, Statement)): + if not isinstance(cypher, (str, Query)): raise TypeError("Statement must be a string or a Statement instance") if not self._connection: @@ -578,8 +578,13 @@ def _assert_open(self): raise TransactionError("Transaction closed") -class Statement: +class Query: + """ Create a new query. + :param text: The query text. + :param metadata: Dictionary of parameters, metadata attached to the query. + :param timeout: Timeout in seconds. + """ def __init__(self, text, metadata=None, timeout=None): self.text = text try: diff --git a/tests/integration/examples/test_autocommit_transaction_example.py b/tests/integration/examples/test_autocommit_transaction_example.py index 96af6d078..97a14f270 100644 --- a/tests/integration/examples/test_autocommit_transaction_example.py +++ b/tests/integration/examples/test_autocommit_transaction_example.py @@ -20,7 +20,7 @@ # tag::autocommit-transaction-import[] -from neo4j.work.simple import Statement +from neo4j.work.simple import Query # end::autocommit-transaction-import[] @@ -39,7 +39,7 @@ def add_person(self, name): # Alternative implementation, with a one second timeout def add_person_within_a_second(self, name): with self.driver.session() as session: - session.run(Statement("CREATE (a:Person {name: $name})", timeout=1.0), name=name) + session.run(Query("CREATE (a:Person {name: $name})", timeout=1.0), name=name) # end::autocommit-transaction[] diff --git a/tests/integration/test_autocommit.py b/tests/integration/test_autocommit.py index a0e3665e4..b62439015 100644 --- a/tests/integration/test_autocommit.py +++ b/tests/integration/test_autocommit.py @@ -22,7 +22,7 @@ import pytest from pytest import raises -from neo4j.work.simple import Statement +from neo4j.work.simple import Query from neo4j.exceptions import Neo4jError, ClientError, TransientError from neo4j.graph import Node, Relationship from neo4j.api import Version @@ -162,7 +162,7 @@ def test_should_not_allow_empty_statements(session): def test_statement_object(session): - value = session.run(Statement("RETURN $x"), x=1).single().value() + value = session.run(Query("RETURN $x"), x=1).single().value() assert value == 1 @@ -183,7 +183,7 @@ def test_autocommit_transactions_should_support_metadata(session, test_input, ne server_agent = summary.server.agent try: - statement = Statement(test_input, metadata=metadata_in) + statement = Query(test_input, metadata=metadata_in) result = session.run(statement) metadata_out = result.single().value() except ClientError as e: @@ -202,8 +202,8 @@ def test_autocommit_transactions_should_support_timeout(neo4j_driver): tx1 = s1.begin_transaction() tx1.run("MATCH (a:Node) SET a.property = 1").consume() with raises(TransientError): - s2.run(Statement("MATCH (a:Node) SET a.property = 2", - timeout=0.25)).consume() + s2.run(Query("MATCH (a:Node) SET a.property = 2", + timeout=0.25)).consume() def test_regex_in_parameter(session): diff --git a/tests/integration/test_explicit_tx.py b/tests/integration/test_explicit_tx.py index 5516e1560..4da6c5500 100644 --- a/tests/integration/test_explicit_tx.py +++ b/tests/integration/test_explicit_tx.py @@ -24,7 +24,7 @@ from pytest import raises -from neo4j.work.simple import Statement, TransactionError +from neo4j.work.simple import Query, TransactionError from neo4j.exceptions import CypherSyntaxError, ClientError, TransientError @@ -125,7 +125,7 @@ def test_broken_transaction_should_not_break_session(session): def test_statement_object_not_supported(session): with session.begin_transaction() as tx: with raises(ValueError): - tx.run(Statement("RETURN 1", timeout=0.25)) + tx.run(Query("RETURN 1", timeout=0.25)) def test_transaction_metadata(session): From 5a30a03b0bab8c171e43cea62602332c2a618403 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 25 Feb 2020 10:20:04 +0100 Subject: [PATCH 5/8] renamed in ResultSummary statement to query statement_type to query_type --- neo4j/work/summary.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neo4j/work/summary.py b/neo4j/work/summary.py index fac0032fc..71842e9f0 100644 --- a/neo4j/work/summary.py +++ b/neo4j/work/summary.py @@ -37,14 +37,14 @@ class ResultSummary: #: The server on which this result was generated. server = None - #: The statement that was executed to produce this result. - statement = None + #: The query that was executed to produce this result. + query = None #: Dictionary of parameters passed with the statement. parameters = None - #: The type of statement (``'r'`` = read-only, ``'rw'`` = read/write). - statement_type = None + #: The type of query (``'r'`` = read-only, ``'rw'`` = read/write). + query_type = None #: A set of statistical information held in a :class:`.Counters` instance. counters = None @@ -71,9 +71,9 @@ def __init__(self, **metadata): self.metadata = metadata self.protocol_version = metadata.get("protocol_version") self.server = metadata.get("server") - self.statement = metadata.get("statement") + self.query = metadata.get("statement") self.parameters = metadata.get("parameters") - self.statement_type = metadata.get("type") + self.query_type = metadata.get("type") self.counters = SummaryCounters(metadata.get("stats", {})) if self.protocol_version[0] < BOLT_VERSION_3: self.result_available_after = metadata.get("result_available_after") From 36cdc2bd3b152f63d0d02a6643cf7c28b2142cec Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 25 Feb 2020 10:47:53 +0100 Subject: [PATCH 6/8] changed the metadata argument statement to be query --- neo4j/work/simple.py | 2 +- neo4j/work/summary.py | 2 +- tests/integration/test_summary.py | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/neo4j/work/simple.py b/neo4j/work/simple.py index bb743fb24..7b3b12881 100644 --- a/neo4j/work/simple.py +++ b/neo4j/work/simple.py @@ -174,7 +174,7 @@ def fail(_): hydrant = DataHydrator() result_metadata = { - "statement": statement_text, + "query": statement_text, "parameters": parameters, "server": server, "protocol_version": protocol_version, diff --git a/neo4j/work/summary.py b/neo4j/work/summary.py index 71842e9f0..82292de82 100644 --- a/neo4j/work/summary.py +++ b/neo4j/work/summary.py @@ -71,7 +71,7 @@ def __init__(self, **metadata): self.metadata = metadata self.protocol_version = metadata.get("protocol_version") self.server = metadata.get("server") - self.query = metadata.get("statement") + self.query = metadata.get("query") self.parameters = metadata.get("parameters") self.query_type = metadata.get("type") self.counters = SummaryCounters(metadata.get("stats", {})) diff --git a/tests/integration/test_summary.py b/tests/integration/test_summary.py index 303d8b436..19bc3b3f4 100644 --- a/tests/integration/test_summary.py +++ b/tests/integration/test_summary.py @@ -20,12 +20,15 @@ import pytest + def test_can_obtain_summary_after_consuming_result(session): + # python -m pytest tests/integration/test_summary.py -s -v -k test_can_obtain_summary_after_consuming_result + result = session.run("CREATE (n) RETURN n") summary = result.summary() - assert summary.statement == "CREATE (n) RETURN n" + assert summary.query == "CREATE (n) RETURN n" assert summary.parameters == {} - assert summary.statement_type == "rw" + assert summary.query_type == "rw" assert summary.counters.nodes_created == 1 From c92b87700dde1a666f250b687a166643b070c450 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 25 Feb 2020 11:49:09 +0100 Subject: [PATCH 7/8] renamed statement to query in class Transaction and Bolt --- neo4j/io/__init__.py | 4 ++-- neo4j/work/simple.py | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/neo4j/io/__init__.py b/neo4j/io/__init__.py index d04e9d846..2933248b4 100644 --- a/neo4j/io/__init__.py +++ b/neo4j/io/__init__.py @@ -215,11 +215,11 @@ def __enter__(self): def __exit__(self, exc_type, exc_value, traceback): self.close() - def run(self, statement, parameters=None, mode=None, bookmarks=None, metadata=None, + def run(self, query, parameters=None, mode=None, bookmarks=None, metadata=None, timeout=None, db=None, **handlers): """ Appends a RUN message to the output stream. - :param statement: Cypher query string + :param query: Cypher query string :param parameters: dictionary of Cypher parameters :param mode: access mode for routing - "READ" or "WRITE" (default) :param bookmarks: iterable of bookmark values after which this transaction should begin diff --git a/neo4j/work/simple.py b/neo4j/work/simple.py index 7b3b12881..c912a5ce4 100644 --- a/neo4j/work/simple.py +++ b/neo4j/work/simple.py @@ -488,40 +488,40 @@ def __exit__(self, exc_type, exc_value, traceback): self._success = not bool(exc_type) self._close() - def run(self, statement, parameters=None, **kwparameters): - """ Run a Cypher statement within the context of this transaction. + def run(self, query, parameters=None, **kwparameters): + """ Run a Cypher query within the context of this transaction. - The statement is sent to the server lazily, when its result is - consumed. To force the statement to be sent to the server, use + The query is sent to the server lazily, when its result is + consumed. To force the query to be sent to the server, use the :meth:`.Transaction.sync` method. - Cypher is typically expressed as a statement template plus a + Cypher is typically expressed as a query template plus a set of named parameters. In Python, parameters may be expressed through a dictionary of parameters, through individual parameter arguments, or as a mixture of both. For example, the `run` - statements below are all equivalent:: + queries below are all equivalent:: - >>> statement = "CREATE (a:Person {name:{name}, age:{age}})" - >>> tx.run(statement, {"name": "Alice", "age": 33}) - >>> tx.run(statement, {"name": "Alice"}, age=33) - >>> tx.run(statement, name="Alice", age=33) + >>> query = "CREATE (a:Person {name:{name}, age:{age}})" + >>> tx.run(query, {"name": "Alice", "age": 33}) + >>> tx.run(query, {"name": "Alice"}, age=33) + >>> tx.run(query, name="Alice", age=33) Parameter values can be of any type supported by the Neo4j type system. In Python, this includes :class:`bool`, :class:`int`, :class:`str`, :class:`list` and :class:`dict`. Note however that :class:`list` properties must be homogenous. - :param statement: template Cypher statement + :param query: template Cypher query :param parameters: dictionary of parameters :param kwparameters: additional keyword parameters :returns: :class:`neo4j.Result` object :raise TransactionError: if the transaction is closed """ self._assert_open() - return self.session.run(statement, parameters, **kwparameters) + return self.session.run(query, parameters, **kwparameters) def sync(self): - """ Force any queued statements to be sent to the server and + """ Force any queued queries to be sent to the server and all related results to be fetched and buffered. :raise TransactionError: if the transaction is closed @@ -601,7 +601,7 @@ def __str__(self): class Result: - """ A handler for the result of Cypher statement execution. Instances + """ A handler for the result of Cypher query execution. Instances of this class are typically constructed and returned by :meth:`.Session.run` and :meth:`.Transaction.run`. """ From f3d7b1a5349dfee99a4364412e1d35a4c3efcd79 Mon Sep 17 00:00:00 2001 From: martin bendsoe Date: Tue, 25 Feb 2020 12:06:39 +0100 Subject: [PATCH 8/8] renamed statement and cypher to query in class Session --- neo4j/work/simple.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/neo4j/work/simple.py b/neo4j/work/simple.py index c912a5ce4..08ad00ffc 100644 --- a/neo4j/work/simple.py +++ b/neo4j/work/simple.py @@ -128,33 +128,33 @@ def close(self): finally: self._disconnect() - def run(self, cypher, parameters=None, **kwparameters): - """ Run a Cypher statement within an auto-commit transaction. + def run(self, query, parameters=None, **kwparameters): + """ Run a Cypher query within an auto-commit transaction. - The statement is sent and the result header received + The query is sent and the result header received immediately but the :class:`neo4j.Result` content is fetched lazily as consumed by the client application. - If a statement is executed before a previous + If a query is executed before a previous :class:`neo4j.Result` in the same :class:`.Session` has been fully consumed, the first result will be fully fetched and buffered. Note therefore that the generally recommended pattern of usage is to fully consume one result before - executing a subsequent statement. If two results need to be + executing a subsequent query. If two results need to be consumed in parallel, multiple :class:`.Session` objects can be used as an alternative to result buffering. For more usage details, see :meth:`.Transaction.run`. - :param cypher: Cypher statement + :param query: Cypher query :param parameters: dictionary of parameters :param kwparameters: additional keyword parameters :returns: :class:`neo4j.Result` object """ - if not cypher: - raise ValueError("Cannot run an empty statement") - if not isinstance(cypher, (str, Query)): - raise TypeError("Statement must be a string or a Statement instance") + if not query: + raise ValueError("Cannot run an empty query") + if not isinstance(query, (str, Query)): + raise TypeError("query must be a string or a Query instance") if not self._connection: self._connect(self._config.default_access_mode) @@ -164,9 +164,9 @@ def run(self, cypher, parameters=None, **kwparameters): has_transaction = self.has_transaction() - statement_text = str(cypher) - statement_metadata = getattr(cypher, "metadata", None) - statement_timeout = getattr(cypher, "timeout", None) + query_text = str(query) + query_metadata = getattr(query, "metadata", None) + query_timeout = getattr(query, "timeout", None) parameters = DataDehydrator.fix_parameters(dict(parameters or {}, **kwparameters)) def fail(_): @@ -174,14 +174,14 @@ def fail(_): hydrant = DataHydrator() result_metadata = { - "query": statement_text, + "query": query_text, "parameters": parameters, "server": server, "protocol_version": protocol_version, } run_metadata = { - "metadata": statement_metadata, - "timeout": statement_timeout, + "metadata": query_metadata, + "timeout": query_timeout, "on_success": result_metadata.update, "on_failure": fail, } @@ -196,9 +196,9 @@ def done(summary_metadata): self._last_result = result = Result(self, hydrant, result_metadata) if has_transaction: - if statement_metadata: + if query_metadata: raise ValueError("Metadata can only be attached at transaction level") - if statement_timeout: + if query_timeout: raise ValueError("Timeouts only apply at transaction level") # TODO: fail if explicit database name has been set else: @@ -206,7 +206,7 @@ def done(summary_metadata): # TODO: capture ValueError and surface as SessionError/TransactionError if # TODO: explicit database selection has been made - cx.run(statement_text, parameters, **run_metadata) + cx.run(query_text, parameters, **run_metadata) cx.pull( on_records=lambda records: result._records.extend( hydrant.hydrate_records(result.keys(), records)),