Skip to content

Commit 8f5af19

Browse files
committed
Fix implicit-optional typing errors
1 parent cbad0e0 commit 8f5af19

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/workflows/transport/common_transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CommonTransport:
3333
#
3434

3535
def __init__(
36-
self, middleware: list[type[middleware.BaseTransportMiddleware]] = None
36+
self, middleware: list[type[middleware.BaseTransportMiddleware]] | None = None
3737
):
3838
if middleware is None:
3939
self.middleware = []

src/workflows/transport/middleware/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ def transaction_begin(
9595
return call_next(subscription_id=subscription_id, **kwargs)
9696

9797
def transaction_abort(
98-
self, call_next: Callable, transaction_id: int = None, **kwargs
98+
self, call_next: Callable, transaction_id: int | None = None, **kwargs
9999
):
100100
call_next(transaction_id, **kwargs)
101101

102102
def transaction_commit(
103-
self, call_next: Callable, transaction_id: int = None, **kwargs
103+
self, call_next: Callable, transaction_id: int | None = None, **kwargs
104104
):
105105
call_next(transaction_id, **kwargs)
106106

@@ -172,7 +172,7 @@ def transaction_commit(self, call_next: Callable, *args, **kwargs):
172172

173173

174174
class TimerMiddleware(BaseTransportMiddleware):
175-
def __init__(self, logger: logging.Logger = None, level=logging.INFO):
175+
def __init__(self, logger: logging.Logger | None = None, level=logging.INFO):
176176
if logger is None:
177177
logger = logging.getLogger(__name__)
178178
self.logger = logger

src/workflows/transport/offline_transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class OfflineTransport(CommonTransport):
2828
config: dict[Any, Any] = {}
2929

3030
def __init__(
31-
self, middleware: list[type[middleware.BaseTransportMiddleware]] = None
31+
self, middleware: list[type[middleware.BaseTransportMiddleware]] | None = None
3232
):
3333
self._connected = False
3434
super().__init__(middleware=middleware)

src/workflows/transport/pika_transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class PikaTransport(CommonTransport):
6363
config: dict[Any, Any] = {}
6464

6565
def __init__(
66-
self, middleware: list[type[middleware.BaseTransportMiddleware]] = None
66+
self, middleware: list[type[middleware.BaseTransportMiddleware]] | None = None
6767
):
6868
self._channel = None
6969
self._conn = None

src/workflows/transport/stomp_transport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class StompTransport(CommonTransport):
3434
config: dict[Any, Any] = {}
3535

3636
def __init__(
37-
self, middleware: list[type[middleware.BaseTransportMiddleware]] = None
37+
self, middleware: list[type[middleware.BaseTransportMiddleware]] | None = None
3838
):
3939
self._connected = False
4040
self._namespace = ""

0 commit comments

Comments
 (0)