Skip to content

Commit 7ccb16b

Browse files
committed
[df] Register Hist() pythonization only if available
If ROOT is built without the root7 option, the method doesn't exist which leads to errors when registering the pythonization. Fixes commit 295345b ("[df] Pythonize Hist() with list of axes") (cherry picked from commit c30f543)
1 parent 79d639d commit 7ccb16b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • bindings/pyroot/pythonizations/python/ROOT/_pythonization

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rdataframe.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ def pythonize_rdataframe(klass):
524524
getter = MethodTemplateGetter(getattr(klass, method_name), HistoProfileWrapper, model_class)
525525
setattr(klass, method_name, getter)
526526

527-
klass.Hist = MethodTemplateGetter(klass.Hist, HistWrapper)
527+
if hasattr(klass, "Hist"):
528+
klass.Hist = MethodTemplateGetter(klass.Hist, HistWrapper)
528529

529530
klass._OriginalFilter = klass.Filter
530531
klass._OriginalDefine = klass.Define

0 commit comments

Comments
 (0)