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:
pass
The 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
PandasTools directly — 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.filterwarnings or 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
Problem
When using THEMAP with pandas 3.0.0 and rdkit 2025.09.4, the following warning appears during featurization:
This is triggered when
get_featurizer()is called (via molfeat's import chain), which importsrdkit.Chem.PandasTools, which in turn importsrdkit.Chem.PandasPatcher.Root Cause
pandas.DataFrame.applymapwas deprecated in pandas 2.1 (renamed toDataFrame.map) and fully removed in pandas 3.0. RDKit 2025.09.4'sPandasPatcher.py(line 91) callspd.DataFrame.applymapunconditionally before the try/except fallback topd.DataFrame.map:The 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
PandasToolsdirectly — the warning is a side-effect of molfeat importing rdkit internalsEnvironment
Options
warnings.filterwarningsor logging filter to hide it until rdkit releases a fixRelated Issues