-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[DF] Let Aliases be defined per computation graph branch, not globally #7381
Copy link
Copy link
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
While users can Define a column with the same name in different branches of the computation graph, that's not true for Aliases: they are global to the computation graph. For example, this fails:
#include <ROOT/RDataFrame.hxx>
#include <iostream>
int main() {
auto df = ROOT::RDataFrame(1).Define("x", [] { return 42; }).Define("y", [] { return 0; });
auto dfzx = df.Alias("z", "x");
auto dfzy = df.Alias("z", "y");
auto max42 = dfzx.Max<int>("z");
auto max0 = dfzy.Max<int>("z");
std::cout << "should be 42: " << *max42 << '\n';
std::cout << "should be 0: " << *max0 << '\n';
return 0;
}Describe the solution you'd like
Aliases should behave the same as Defines, we should track them per-computation-graph-branch rather than per-computation-graph.
Additional context
That would make it possible to Redefine aliases, which is currently not a thing because we don't want a computation-graph-branch-local Redefine to undefine a global Alias.
Reactions are currently unavailable