Skip to content

[6.40] Backport recent fix - #23176

Merged
vepadulano merged 1 commit into
root-project:v6-40-00-patchesfrom
vepadulano:gh-23072-v640
Aug 28, 2026
Merged

vepadulano merged 1 commit into
root-project:v6-40-00-patchesfrom
vepadulano:gh-23072-v640

Conversation

@vepadulano

Copy link
Copy Markdown
Member

Backport of #23164

…d module at exit time

The distributed RDataFrame Python module raises a warning to let users know it
has been moved out of the `Experimental` namespace. This was implemented by
creating a dummy Python class type that injects the warning at
`__getattribute__` time and using that class as the class of the injected
distributed module when the user accesses it via `Experimental`.

That implementation may have undesired interactions in extreme edge-cases. For
example, if a third-party library accesses available Python modules during the
session and inspects them, the distributed Python module warning could be
triggered. One notable example are the XRootD Python bindings. The `client`
module of this package registers a function with `atexit`. At exit time, that
function accesses all objects available to the garbage collector, which includes
all Python modules (even external to XRootD itself). See the implementation at:

https://github.com/xrootd/xrootd/blob/v6.1.1/python/libs/client/finalize.py

While accessing all these objects, XRootD is also accessing ROOT modules if ROOT
was imported in the same application. As such, the dummy class behaviour
explained above kicked in.

This commit proposes to change the implementation that raises the warning to use
a mechanism based on function decorators. The downside is a few more lines of
code: every function supposed to be accessed publicly of the distributed module
must be decorated so that the warning is raised before the function runs if the
user is accessing it via `Experimental`. The upside is avoiding the scenario
described above and having the warning raised right at the point of calling the
function rather than slightly earlier during module attribute access.

Co-authored-by: Silia Taider <silia.taider@cern.ch>
@vepadulano vepadulano self-assigned this Aug 28, 2026
@vepadulano
vepadulano merged commit 2255c6b into root-project:v6-40-00-patches Aug 28, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant