From c03c1803477c9e1957a28d14f61cd3811015bdae Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Fri, 24 Apr 2026 09:57:49 +0200 Subject: [PATCH] [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 295345ba1c ("[df] Pythonize Hist() with list of axes") --- .../pythonizations/python/ROOT/_pythonization/_rdataframe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rdataframe.py b/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rdataframe.py index f1ab51e4a3c43..a19a270c3f0db 100644 --- a/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rdataframe.py +++ b/bindings/pyroot/pythonizations/python/ROOT/_pythonization/_rdataframe.py @@ -524,7 +524,8 @@ def pythonize_rdataframe(klass): getter = MethodTemplateGetter(getattr(klass, method_name), HistoProfileWrapper, model_class) setattr(klass, method_name, getter) - klass.Hist = MethodTemplateGetter(klass.Hist, HistWrapper) + if hasattr(klass, "Hist"): + klass.Hist = MethodTemplateGetter(klass.Hist, HistWrapper) klass._OriginalFilter = klass.Filter klass._OriginalDefine = klass.Define