-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
When using THEMAP with pandas 3.0.0 and rdkit 2025.09.4, the following warning appears during featurization:
Failed to patch pandas - PandasTools will have limited functionality
This is triggered when get_featurizer() is called (via molfeat's import chain), which imports rdkit.Chem.PandasTools, which in turn imports rdkit.Chem.PandasPatcher.
Root Cause
pandas.DataFrame.applymap was deprecated in pandas 2.1 (renamed to DataFrame.map) and fully removed in pandas 3.0. RDKit 2025.09.4's PandasPatcher.py (line 91) calls pd.DataFrame.applymap unconditionally before the try/except fallback to pd.DataFrame.map:
# rdkit/Chem/PandasPatcher.py (installed version)
dataframe_applymap = pd.DataFrame.applymap # line 91 — raises AttributeError on pandas 3.0
try:
if tuple(map(int, (pd.__version__.split(".")))) >= (2, 1, 0):
dataframe_applymap = pd.DataFrame.map # line 94 — never reached
except:
passThe fix exists on rdkit's master branch (reverses the try/except order), but hasn't been released in a pip-installable rdkit package yet. The latest available version is 2025.09.4.
Impact
- THEMAP does not use
PandasToolsdirectly — the warning is a side-effect of molfeat importing rdkit internals - The warning is cosmetic and does not affect THEMAP's distance computation or featurization results
- May confuse users into thinking something is broken
Environment
- pandas 3.0.0
- rdkit 2025.09.4
- Python 3.11
Options
- Pin pandas < 3.0 — avoids the issue but blocks access to pandas 3.0 features and future releases
- Suppress the warning — add a
warnings.filterwarningsor logging filter to hide it until rdkit releases a fix - Wait for upstream fix — rdkit master already has the fix; wait for next release (2025.09.5+)
- Pin pandas < 3.0 temporarily + track upstream rdkit release to unpin later
Related Issues
- rdkit/rdkit#6993 — original deprecation warning report (closed as stale, not fixed)
- pandas-dev/pandas#52353 — rename applymap → map
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working