Skip to content

Commit

Permalink
Fix dask_cudf.to_orc deprecation (#18038)
Browse files Browse the repository at this point in the history
**TLDR**: This PR adds a trivial change to avoid multiple deprecation-warning stages when `import dask_cudf.to_orc` is called.

Dask cuDF uses a `_deprecated_api` utility to discourage users from importing IO functions from `dask_cudf.io`. We also encourage users to leverage `DataFrame` methods in lieu of stand-alone functions for output IO. For example, we want people to call `df.to_orc(...)` (and to avoid patterns like `from dask_cudf import to_orc`).

It turns out that the calling `import dask_cudf.to_orc` currently results in **two** deprecation warnings being raised before the "real" `dask_cudf.io.orc.to_orc` implementation is reached. This is because the first `dask_cudf.to_orc` import is incorrectly redirected to `dask_cudf.io.to_orc` (rather than `dask_cudf.io.orc.to_orc`). This subtle bug doesn't seem to cause problems in CI right now, but I do see local failures in `test_orc.py::test_deprecated_api_paths` with a slightly different environment (not sure of the specific differences atm).

Authors:
  - Richard (Rick) Zamora (https://github.com/rjzamora)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Matthew Murray (https://github.com/Matt711)
  - Tom Augspurger (https://github.com/TomAugspurger)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #18038
  • Loading branch information
rjzamora authored Feb 24, 2025
1 parent d0e219e commit d4c62ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/dask_cudf/dask_cudf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def read_parquet(*args, **kwargs):
read_text = DataFrame.read_text
to_orc = _deprecated_api(
"dask_cudf.to_orc",
new_api="dask_cudf.io.to_orc",
new_api="dask_cudf.io.orc.to_orc",
rec="Please use DataFrame.to_orc instead.",
)

Expand Down

0 comments on commit d4c62ef

Please sign in to comment.