Skip to content
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

Merged
merged 1 commit into from
Jan 28, 2025
Merged

remove extra / old prefect-dask usage docs #16872

merged 1 commit into from
Jan 28, 2025

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Jan 28, 2025

closes #16865

@zzstoatzz zzstoatzz changed the title remove extra / old usage docs remove extra / old prefect-dask usage docs Jan 28, 2025
@github-actions github-actions bot added docs bug Something isn't working labels Jan 28, 2025
Copy link
Collaborator Author

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

@zzstoatzz zzstoatzz added the integrations Related to integrations with other services label Jan 28, 2025
Comment on lines +403 to +428

<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.
Copy link
Collaborator Author

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

@zzstoatzz zzstoatzz merged commit d00a05e into main Jan 28, 2025
13 checks passed
@zzstoatzz zzstoatzz deleted the dedupe-dask-docs branch January 28, 2025 16:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working docs integrations Related to integrations with other services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The prefect-dask documentation is repeated twice
2 participants