|
33 | 33 | _R = t.TypeVar("_R") |
34 | 34 | _P = te.ParamSpec("_P") |
35 | 35 |
|
| 36 | + |
| 37 | + |
36 | 38 | from ..._async_compat import async_sleep |
37 | 39 | from ..._async_compat.util import AsyncUtil |
38 | 40 | from ..._conf import SessionConfig |
@@ -236,7 +238,7 @@ def cancel(self) -> None: |
236 | 238 | async def run( |
237 | 239 | self, |
238 | 240 | query: t.Union[str, Query], |
239 | | - parameters: t.Dict[str, t.Any] = None, |
| 241 | + parameters: t.Optional[t.Dict[str, t.Any]] = None, |
240 | 242 | **kwargs: t.Any |
241 | 243 | ) -> AsyncResult: |
242 | 244 | """Run a Cypher query within an auto-commit transaction. |
@@ -321,7 +323,7 @@ async def last_bookmark(self) -> t.Optional[str]: |
321 | 323 | if self._auto_result: |
322 | 324 | await self._auto_result.consume() |
323 | 325 |
|
324 | | - if self._transaction and self._transaction._closed: |
| 326 | + if self._transaction and self._transaction._closed(): |
325 | 327 | await self._update_bookmark(self._transaction._database, |
326 | 328 | self._transaction._bookmark) |
327 | 329 | self._transaction = None |
@@ -405,8 +407,8 @@ async def _open_transaction( |
405 | 407 |
|
406 | 408 | async def begin_transaction( |
407 | 409 | self, |
408 | | - metadata: t.Dict[str, t.Any] = None, |
409 | | - timeout: float = None |
| 410 | + metadata: t.Optional[t.Dict[str, t.Any]] = None, |
| 411 | + timeout: t.Optional[float] = None |
410 | 412 | ) -> AsyncTransaction: |
411 | 413 | """ Begin a new unmanaged transaction. Creates a new :class:`.AsyncTransaction` within this session. |
412 | 414 | At most one transaction may exist in a session at any point in time. |
|
0 commit comments