[FEA] Warn on cudf.pandas install if pandas is already loaded
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
If using the IPython magic to load cudf.pandas, if pandas has already been loaded then the existing module will not be changed. We do rewrite sys.modules, but that will not change local variables where the user has stored the module (i.e. any module where they have already done `import pandas as pd`). We currently document this requirement, but it remains a potentially error-prone requirement for unfamiliar users.
**Describe the solution you'd like**
We should attempt to make this easier for users by providing a loud warning when they load the accelerator mid-interpreter/Jupyter notebook. We cannot make this an error because we have no guarantee that IPython (or something that it imports before starting up the interactive interpreter) won't gain a pandas dependency, and we don't want such a change to suddenly break all usage of cudf.pandas. Additionally, since cudf currently imports pandas in many places, we are effectively guaranteed that pandas will already be in sys.modules before we reach the point in cudf.pandas that installs the module accelerator. We will need to add some way of detecting whether pandas was already installed before loading cudf itself, otherwise cudf.pandas will always think pandas was loaded by the time we load up the accelerator.
Contributor guide
Assessment
This issue has not been assessed yet.