-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
remove extra / old prefect-dask
usage docs
#16872
Conversation
prefect-dask
usage docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this whole section already exists in the index.mdx
and no other collections have a separate usage guide
page, its all just embedded in the index
like this one is now
|
||
<Warning> | ||
**Resolving futures in sync client** | ||
|
||
Note, by default, `dask_collection.compute()` returns concrete values while `client.compute(dask_collection)` returns Dask Futures. Therefore, if you call `client.compute`, you must resolve all futures before exiting out of the context manager by either: | ||
|
||
1. setting `sync=True` | ||
```python | ||
with get_dask_client() as client: | ||
df = dask.datasets.timeseries("2000", "2001", partition_freq="4w") | ||
summary_df = client.compute(df.describe(), sync=True) | ||
``` | ||
|
||
2. calling `result()` | ||
```python | ||
with get_dask_client() as client: | ||
df = dask.datasets.timeseries("2000", "2001", partition_freq="4w") | ||
summary_df = client.compute(df.describe()).result() | ||
``` | ||
For more information, visit the docs on [Waiting on Futures](https://docs.dask.org/en/stable/futures.html#waiting-on-futures). | ||
</Warning> | ||
|
||
There is also an equivalent context manager for asynchronous tasks and flows: `get_async_dask_client`. When using the async client, you must `await client.compute(dask_collection)` before exiting the context manager. | ||
|
||
Note that task submission (`.submit()`) and future resolution (`.result()`) are always synchronous operations in Prefect, even when working with async tasks and flows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it appeared this was the only section unique to the "usage guide" page
closes #16865