Skip to content

Commit b147771

Browse files
committed
Typing fixes
1 parent 1fec723 commit b147771

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

temporalio/worker/_activity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ def _raise_in_thread_if_pending_unlocked(self) -> None:
679679

680680

681681
class _ActivityInboundImpl(ActivityInboundInterceptor):
682-
def __init__(
682+
def __init__( # type: ignore[reportMissingSuperCall]
683683
self, worker: _ActivityWorker, running_activity: _RunningActivity
684684
) -> None:
685685
# We are intentionally not calling the base class's __init__ here
@@ -786,7 +786,7 @@ async def heartbeat_with_context(*details: Any) -> None:
786786

787787

788788
class _ActivityOutboundImpl(ActivityOutboundInterceptor):
789-
def __init__(self, worker: _ActivityWorker, info: temporalio.activity.Info) -> None:
789+
def __init__(self, worker: _ActivityWorker, info: temporalio.activity.Info) -> None: # type: ignore[reportMissingSuperCall]
790790
# We are intentionally not calling the base class's __init__ here
791791
self._worker = worker
792792
self._info = info

temporalio/worker/_worker.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,12 +577,12 @@ def config(self) -> WorkerConfig:
577577
@property
578578
def task_queue(self) -> str:
579579
"""Task queue this worker is on."""
580-
return self._config["task_queue"]
580+
return self._config["task_queue"] # type: ignore[reportTypedDictNotRequiredAccess]
581581

582582
@property
583583
def client(self) -> temporalio.client.Client:
584584
"""Client currently set on the worker."""
585-
return self._config["client"]
585+
return self._config["client"] # type: ignore[reportTypedDictNotRequiredAccess]
586586

587587
@client.setter
588588
def client(self, value: temporalio.client.Client) -> None:
@@ -679,9 +679,9 @@ async def raise_on_shutdown():
679679
)
680680
if exception:
681681
logger.error("Worker failed, shutting down", exc_info=exception)
682-
if self._config["on_fatal_error"]:
682+
if self._config["on_fatal_error"]: # type: ignore[reportTypedDictNotRequiredAccess]
683683
try:
684-
await self._config["on_fatal_error"](exception)
684+
await self._config["on_fatal_error"](exception) # type: ignore[reportTypedDictNotRequiredAccess]
685685
except:
686686
logger.warning("Fatal error handler failed")
687687

@@ -692,7 +692,7 @@ async def raise_on_shutdown():
692692

693693
# Cancel the shutdown task (safe if already done)
694694
tasks[None].cancel()
695-
graceful_timeout = self._config["graceful_shutdown_timeout"]
695+
graceful_timeout = self._config["graceful_shutdown_timeout"] # type: ignore[reportTypedDictNotRequiredAccess]
696696
logger.info(
697697
f"Beginning worker shutdown, will wait {graceful_timeout} before cancelling activities"
698698
)

tests/worker/test_activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ async def some_activity(param1: SomeClass2, param2: str) -> str:
612612
result.result
613613
== "param1: <class 'tests.worker.test_activity.SomeClass2'>, param2: <class 'str'>"
614614
)
615-
assert activity_param1 == SomeClass2(foo="str1", bar=SomeClass1(foo=123))
615+
assert activity_param1 == SomeClass2(foo="str1", bar=SomeClass1(foo=123)) # type: ignore[reportUnboundVariable] # noqa
616616

617617

618618
async def test_activity_heartbeat_details(

0 commit comments

Comments
 (0)