Skip to content

Commit aaccb00

Browse files
committed
Use a lambda to wrap task creation to appease the type linter
1 parent 7ae97d0 commit aaccb00

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

temporalio/contrib/openai_agents/_trace_interceptor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ async def start_child_workflow(
431431
)
432432
else:
433433
handle: temporalio.workflow.ChildWorkflowHandle = await ctx.run(
434-
asyncio.create_task, self.next.start_child_workflow(input)
434+
lambda: asyncio.create_task(self.next.start_child_workflow(input))
435435
)
436436
if span:
437437
handle.add_done_callback(lambda _: ctx.run(span.finish)) # type: ignore

temporalio/contrib/opentelemetry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
Any,
1616
Callable,
1717
ContextManager,
18+
Coroutine,
1819
Dict,
1920
Iterator,
2021
Mapping,
@@ -423,7 +424,7 @@ async def handle_signal(self, input: temporalio.worker.HandleSignalInput) -> Non
423424
if sys.version_info >= (3, 11):
424425
await asyncio.create_task(self._handle_signal(input), context=ctx)
425426
else:
426-
await ctx.run(asyncio.create_task, self._handle_signal(input))
427+
await ctx.run(lambda: asyncio.create_task(self._handle_signal(input)))
427428

428429
async def _handle_signal(self, input: temporalio.worker.HandleSignalInput) -> None:
429430
"""Implementation of

0 commit comments

Comments
 (0)