Skip to content

Commit

Permalink
Avoid importing dask-expr if "query-planning" config is False (#15340)
Browse files Browse the repository at this point in the history
During some offline debugging with @bdice and @divyegala, we discovered that some cuml tests are somehow failing after `dask_expr` is imported - Even if `dask_expr` is not actually being used. I'd like to figure out exactly what is causing that problem, but the first thing we can/should do is avoid the import altogether when the "query-planning" config is set to `False`.

Authors:
  - Richard (Rick) Zamora (https://github.com/rjzamora)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #15340
  • Loading branch information
rjzamora authored Mar 19, 2024
1 parent 7cc02e5 commit f9ac427
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/dask_cudf/dask_cudf/expr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
QUERY_PLANNING_ON = config.get("dataframe.query-planning", None) is not False

# Register custom expressions and collections
try:
import dask_cudf.expr._collection
import dask_cudf.expr._expr
if QUERY_PLANNING_ON:
try:
import dask_cudf.expr._collection
import dask_cudf.expr._expr

except ImportError as err:
if QUERY_PLANNING_ON:
except ImportError as err:
# Dask *should* raise an error before this.
# However, we can still raise here to be certain.
raise RuntimeError(
Expand Down

0 comments on commit f9ac427

Please sign in to comment.