|
26 | 26 | from ..._async_compat import async_sleep
|
27 | 27 | from ..._async_compat.util import AsyncUtil
|
28 | 28 | 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 |
| - |
36 | 29 | from ..._util import ContextBool
|
37 | 30 | from ..._work import Query
|
38 | 31 | from ...api import (
|
@@ -673,51 +666,6 @@ async def get_two_tx(tx):
|
673 | 666 | kwargs,
|
674 | 667 | )
|
675 | 668 |
|
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 |
| - |
721 | 669 | @AsyncNonConcurrentMethodChecker._non_concurrent_method
|
722 | 670 | async def execute_write(
|
723 | 671 | self,
|
@@ -779,51 +727,6 @@ async def create_node_tx(tx, name):
|
779 | 727 | kwargs,
|
780 | 728 | )
|
781 | 729 |
|
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 |
| - |
827 | 730 |
|
828 | 731 | def retry_delay_generator(initial_delay, multiplier, jitter_factor):
|
829 | 732 | delay = initial_delay
|
|
0 commit comments