Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Jun 17, 2024
1 parent e3cca0e commit d4dbd4f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion compat-tests
6 changes: 0 additions & 6 deletions src/integrations/prefect-dask/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ def event_loop(request):
# Workaround for failures in pytest_asyncio 0.17;
# see https://github.com/pytest-dev/pytest-asyncio/issues/257
policy.set_event_loop(loop)


@pytest.fixture(autouse=True)
def fetch_state_result():
with temporary_settings(updates={PREFECT_ASYNC_FETCH_STATE_RESULT: True}):
yield
15 changes: 10 additions & 5 deletions src/prefect/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,22 +1184,25 @@ def __call__(self: "Flow[P, NoReturn]", *args: P.args, **kwargs: P.kwargs) -> No
@overload
def __call__(
self: "Flow[P, Coroutine[Any, Any, T]]", *args: P.args, **kwargs: P.kwargs
) -> Awaitable[T]: ...
) -> Awaitable[T]:
...

@overload
def __call__(
self: "Flow[P, T]",
*args: P.args,
**kwargs: P.kwargs,
) -> T: ...
) -> T:
...

@overload
def __call__(
self: "Flow[P, T]",
*args: P.args,
return_state: Literal[True],
**kwargs: P.kwargs,
) -> State[T]: ...
) -> State[T]:
...

def __call__(
self,
Expand Down Expand Up @@ -1337,7 +1340,8 @@ async def visualize(self, *args, **kwargs):


@overload
def flow(__fn: Callable[P, R]) -> Flow[P, R]: ...
def flow(__fn: Callable[P, R]) -> Flow[P, R]:
...


@overload
Expand Down Expand Up @@ -1368,7 +1372,8 @@ def flow(
] = None,
on_crashed: Optional[List[Callable[[FlowSchema, FlowRun, State], None]]] = None,
on_running: Optional[List[Callable[[FlowSchema, FlowRun, State], None]]] = None,
) -> Callable[[Callable[P, R]], Flow[P, R]]: ...
) -> Callable[[Callable[P, R]], Flow[P, R]]:
...


def flow(
Expand Down
24 changes: 16 additions & 8 deletions src/prefect/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,17 @@ def __call__(
self: "Task[P, T]",
*args: P.args,
**kwargs: P.kwargs,
) -> T: ...
) -> T:
...

@overload
def __call__(
self: "Task[P, T]",
*args: P.args,
return_state: Literal[True],
**kwargs: P.kwargs,
) -> State[T]: ...
) -> State[T]:
...

def __call__(
self,
Expand Down Expand Up @@ -825,7 +827,8 @@ def submit(
self: "Task[P, T]",
*args: P.args,
**kwargs: P.kwargs,
) -> PrefectFuture: ...
) -> PrefectFuture:
...

@overload
def submit(
Expand All @@ -834,7 +837,8 @@ def submit(
wait_for: Optional[Iterable[PrefectFuture]] = None,
*args: P.args,
**kwargs: P.kwargs,
) -> State[T]: ...
) -> State[T]:
...

def submit(
self,
Expand Down Expand Up @@ -973,15 +977,17 @@ def map(
self: "Task[P, T]",
*args: P.args,
**kwargs: P.kwargs,
) -> List[PrefectFuture]: ...
) -> List[PrefectFuture]:
...

@overload
def map(
self: "Task[P, T]",
return_state: Literal[True],
*args: P.args,
**kwargs: P.kwargs,
) -> List[State[T]]: ...
) -> List[State[T]]:
...

def map(
self,
Expand Down Expand Up @@ -1297,7 +1303,8 @@ def serve(self) -> "Task":


@overload
def task(__fn: Callable[P, R]) -> Task[P, R]: ...
def task(__fn: Callable[P, R]) -> Task[P, R]:
...


@overload
Expand Down Expand Up @@ -1333,7 +1340,8 @@ def task(
on_failure: Optional[List[Callable[["Task", TaskRun, State], None]]] = None,
retry_condition_fn: Optional[Callable[["Task", TaskRun, State], bool]] = None,
viz_return_value: Any = None,
) -> Callable[[Callable[P, R]], Task[P, R]]: ...
) -> Callable[[Callable[P, R]], Task[P, R]]:
...


def task(
Expand Down

0 comments on commit d4dbd4f

Please sign in to comment.