Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/oracledb/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,22 @@
import collections
import functools
import ssl
from typing import Any, Callable, Type, Union

import oracledb

from . import __name__ as MODULE_NAME

from typing import Any, Callable, Type, Union
from . import constants, driver_mode, errors
from . import base_impl, thick_impl, thin_impl
from . import base_impl, constants, driver_mode, errors, thick_impl, thin_impl
from . import pool as pool_module
from .pipeline import Pipeline
from .aq import MessageProperties, Queue
from .base_impl import DB_TYPE_BLOB, DB_TYPE_CLOB, DB_TYPE_NCLOB, DbType
from .connect_params import ConnectParams
from .cursor import AsyncCursor, Cursor
from .lob import AsyncLOB, LOB
from .subscr import Subscription
from .aq import Queue, MessageProperties
from .dbobject import DbObject, DbObjectType
from .lob import LOB, AsyncLOB
from .pipeline import Pipeline
from .soda import SodaDatabase
from .dbobject import DbObjectType, DbObject
from .base_impl import DB_TYPE_BLOB, DB_TYPE_CLOB, DB_TYPE_NCLOB, DbType
from .subscr import Subscription

# named tuple used for representing global transactions
Xid = collections.namedtuple(
Expand Down Expand Up @@ -1165,7 +1163,9 @@ def unsubscribe(self, subscr: Subscription) -> None:
subscr._impl.unsubscribe(self._impl)


def _connection_factory(f):
def _connection_factory(
f: Callable[..., Connection],
) -> Callable[..., Connection]:
"""
Decorator which checks the validity of the supplied keyword parameters by
calling the original function (which does nothing), then creates and
Expand Down Expand Up @@ -1923,7 +1923,9 @@ async def tpc_rollback(self, xid: Xid = None) -> None:
await self._impl.tpc_rollback(xid)


def _async_connection_factory(f):
def _async_connection_factory(
f: Callable[..., AsyncConnection],
) -> Callable[..., AsyncConnection]:
"""
Decorator which checks the validity of the supplied keyword parameters by
calling the original function (which does nothing), then creates and
Expand Down