Skip to content

Commit 798e0d9

Browse files
committed
Remove session.read/write_transaction
1 parent e222c58 commit 798e0d9

File tree

3 files changed

+2
-194
lines changed

3 files changed

+2
-194
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
5757
- Remove deprecated class `neo4j.Bookmark` in favor of `neo4j.Bookmarks`.
5858
- Remove deprecated class `session.last_bookmark()` in favor of `last_bookmarks()`.
5959
- Make undocumented classes `ResolvedAddress`, `ResolvedIPv4Address`, and `ResolvedIPv6Address` private.
60+
- Remove deprecated `session.read_transaction` and `session.write_transaction`.
61+
Instead, use `session.execute_read` and `session.execute_write` respectively.
6062

6163

6264
## Version 5.28

src/neo4j/_async/work/session.py

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
from ..._async_compat import async_sleep
2727
from ..._async_compat.util import AsyncUtil
2828
from ..._conf import SessionConfig
29-
30-
31-
if t.TYPE_CHECKING:
32-
from typing_extensions import deprecated
33-
else:
34-
from ..._meta import deprecated
35-
3629
from ..._util import ContextBool
3730
from ..._work import Query
3831
from ...api import (
@@ -673,51 +666,6 @@ async def get_two_tx(tx):
673666
kwargs,
674667
)
675668

676-
# TODO: 6.0 - Remove this method
677-
@deprecated("read_transaction has been renamed to execute_read")
678-
@AsyncNonConcurrentMethodChecker._non_concurrent_method
679-
async def read_transaction(
680-
self,
681-
transaction_function: t.Callable[
682-
te.Concatenate[AsyncManagedTransaction, _P], t.Awaitable[_R]
683-
],
684-
*args: _P.args,
685-
**kwargs: _P.kwargs,
686-
) -> _R:
687-
"""
688-
Execute a unit of work in a managed read transaction.
689-
690-
.. note::
691-
This does not necessarily imply access control, see the session
692-
configuration option :ref:`default-access-mode-ref`.
693-
694-
:param transaction_function: a function that takes a transaction as an
695-
argument and does work with the transaction.
696-
``transaction_function(tx, *args, **kwargs)`` where ``tx`` is a
697-
:class:`.AsyncManagedTransaction`.
698-
:type transaction_function:
699-
typing.Callable[[AsyncManagedTransaction, P], typing.Awaitable[R]]
700-
:param args: additional arguments for the `transaction_function`
701-
:type args: P
702-
:param kwargs: key word arguments for the `transaction_function`
703-
:type kwargs: P
704-
705-
:returns: a result as returned by the given unit of work
706-
:rtype: R
707-
708-
:raises SessionError: if the session has been closed.
709-
710-
.. deprecated:: 5.0
711-
Method was renamed to :meth:`.execute_read`.
712-
"""
713-
return await self._run_transaction(
714-
READ_ACCESS,
715-
TelemetryAPI.TX_FUNC,
716-
transaction_function,
717-
args,
718-
kwargs,
719-
)
720-
721669
@AsyncNonConcurrentMethodChecker._non_concurrent_method
722670
async def execute_write(
723671
self,
@@ -779,51 +727,6 @@ async def create_node_tx(tx, name):
779727
kwargs,
780728
)
781729

782-
# TODO: 6.0 - Remove this method
783-
@deprecated("write_transaction has been renamed to execute_write")
784-
@AsyncNonConcurrentMethodChecker._non_concurrent_method
785-
async def write_transaction(
786-
self,
787-
transaction_function: t.Callable[
788-
te.Concatenate[AsyncManagedTransaction, _P], t.Awaitable[_R]
789-
],
790-
*args: _P.args,
791-
**kwargs: _P.kwargs,
792-
) -> _R:
793-
"""
794-
Execute a unit of work in a managed write transaction.
795-
796-
.. note::
797-
This does not necessarily imply access control, see the session
798-
configuration option :ref:`default-access-mode-ref`.
799-
800-
:param transaction_function: a function that takes a transaction as an
801-
argument and does work with the transaction.
802-
``transaction_function(tx, *args, **kwargs)`` where ``tx`` is a
803-
:class:`.AsyncManagedTransaction`.
804-
:type transaction_function:
805-
typing.Callable[[AsyncManagedTransaction, P], typing.Awaitable[R]]
806-
:param args: additional arguments for the `transaction_function`
807-
:type args: P
808-
:param kwargs: key word arguments for the `transaction_function`
809-
:type kwargs: P
810-
811-
:returns: a result as returned by the given unit of work
812-
:rtype: R
813-
814-
:raises SessionError: if the session has been closed.
815-
816-
.. deprecated:: 5.0
817-
Method was renamed to :meth:`.execute_write`.
818-
"""
819-
return await self._run_transaction(
820-
WRITE_ACCESS,
821-
TelemetryAPI.TX_FUNC,
822-
transaction_function,
823-
args,
824-
kwargs,
825-
)
826-
827730

828731
def retry_delay_generator(initial_delay, multiplier, jitter_factor):
829732
delay = initial_delay

src/neo4j/_sync/work/session.py

Lines changed: 0 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)