diff --git a/docs/cudf/source/developer_guide/cudf_pandas.md b/docs/cudf/source/developer_guide/cudf_pandas.md index a8a6d81d6fb..911a64fa152 100644 --- a/docs/cudf/source/developer_guide/cudf_pandas.md +++ b/docs/cudf/source/developer_guide/cudf_pandas.md @@ -136,3 +136,21 @@ Arrays are not almost equal to 7 decimals ACTUAL: 1.0 DESIRED: 2.0. ``` + +Setting the environment variable `CUDF_PANDAS_FAIL_ON_FALLBACK` causes `cudf.pandas` to fail when falling back from cuDF to Pandas. +For example, +```python +import cudf.pandas +cudf.pandas.install() +import pandas as pd +import numpy as np + +df = pd.DataFrame({ + 'complex_col': [1 + 2j, 3 + 4j, 5 + 6j] +}) + +print(df) +``` +``` +ProxyFallbackError: The operation failed with cuDF, the reason was : Series with Complex128DType is not supported. +``` diff --git a/python/cudf/cudf/pandas/fast_slow_proxy.py b/python/cudf/cudf/pandas/fast_slow_proxy.py index 0c1cda8810b..c364d55e677 100644 --- a/python/cudf/cudf/pandas/fast_slow_proxy.py +++ b/python/cudf/cudf/pandas/fast_slow_proxy.py @@ -965,7 +965,7 @@ def _fast_slow_function_call( except Exception as err: if _env_get_bool("CUDF_PANDAS_FAIL_ON_FALLBACK", False): raise ProxyFallbackError( - f"The operation failed with cuDF, the reason was {type(err)}: {err}." + f"The operation failed with cuDF, the reason was {type(err)}: {err}" ) from err with nvtx.annotate( "EXECUTE_SLOW",