Skip to content

Commit

Permalink
Merge branch 'main' into sqlalchemy-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdw authored Jan 16, 2025
2 parents 5ec3ed0 + e18e438 commit 9eac0f5
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 49 deletions.
6 changes: 3 additions & 3 deletions src/prefect/client/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This module must not import from `prefect.client` when it is imported to avoid
# circular imports for decorators such as `inject_client` which are widely used.

from collections.abc import Awaitable, Coroutine
from collections.abc import Coroutine
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, Optional, Union

Expand Down Expand Up @@ -61,8 +61,8 @@ def get_or_create_client(


def client_injector(
func: Callable[Concatenate["PrefectClient", P], Awaitable[R]],
) -> Callable[P, Awaitable[R]]:
func: Callable[Concatenate["PrefectClient", P], Coroutine[Any, Any, R]],
) -> Callable[P, Coroutine[Any, Any, R]]:
@wraps(func)
async def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
client, _ = get_or_create_client()
Expand Down
6 changes: 5 additions & 1 deletion src/prefect/input/actions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
from typing import TYPE_CHECKING, Any, Optional, Set
from uuid import UUID

Expand Down Expand Up @@ -44,9 +45,12 @@ async def create_flow_run_input_from_model(
else:
json_safe = orjson.loads(model_instance.json())

await create_flow_run_input(
coro = create_flow_run_input(
key=key, value=json_safe, flow_run_id=flow_run_id, sender=sender
)
if TYPE_CHECKING:
assert inspect.iscoroutine(coro)
await coro


@sync_compatible
Expand Down
Loading

0 comments on commit 9eac0f5

Please sign in to comment.