PrefectHQ / prefect

Prefect is a workflow orchestration tool empowering developers to build, observe, and react to data pipelines
https://prefect.io
Apache License 2.0
15.29k stars 1.5k forks source link

Missing overload for `get_client()` #14104

Closed hikariatama closed 1 week ago

hikariatama commented 1 week ago

First check

Prefect Version

3.x

Describe the current behavior

Due to missing overload, pyright reports

async with get_client(sync_client=False) as client:
    ...

as error, since get_client returns Union["PrefectClient", "SyncPrefectClient"].

Describe the proposed behavior

Add typing overloads for client to get rid of error at least with the explicit argument sync_client

Example Use

No response

Additional context

No response

desertaxle commented 1 week ago

Thanks for the issue @hikariatama! This was fixed in https://github.com/PrefectHQ/prefect/pull/13763 and the fix is available in 3.0.0rc3. I'm going to close this, but feel free to reply if you encounter any other issues with get_client typing!