Simple Filter -> Snapshot fails

When trying to quickly save a reduced dataset, I encountered this problem.

I tried to save the result of a Filter into a variable, but this fails:

root [0] using namespace ROOT::Experimental;
root [1] TDataFrame df("Drell-Yan", "dy_tuple_12_md.root");
root [2] auto sig = df.Filter("Z0_ENDVERTEX_CHI2 < 5.")
ERROR in cling::executePrintValue(): cannot pass value!
(ROOT::Experimental::TDF::TInterface<TFilterBase> &) ERROR in cling::executePrintValue(): missing value string.

In comparison, directly saving a snapshot seems to work:

root [0] using namespace ROOT::Experimental;
root [1] TDataFrame df("Drell-Yan", "dy_tuple_12_md.root");
root [2] df.Filter("Z0_ENDVERTEX_CHI2 < 5").Snapshot("Drell-Yan", "dy_tuple_12_md_signal.root")
(ROOT::Experimental::TDF::TInterface<ROOT::Experimental::TDF::TInterface<ROOT::Detail::TDF::TFilterBase>::TLoopManager>) @0x5626ff5c5290

Have you tried making the input and output tree names different? That could be the problem.

Hi, that is a failure in printing the name of the type returned by the filter. The TDataFrame itself is fine and you can safely use it.

There is a jira issue already open regarding this issue with the root prompt, it will be hopefully fixed soon.

The error message should go away if you end the line with a “;”, inhibiting typename printing.

edit: jira issue is here

Note that the error appears before calling Snapshot, so the treename there cannot have any effect on it.

Ok, thanks for the answer. This error also shows up when using ; at the end and then afterwards trying to inspect it:

root [3] sig
ERROR in cling::executePrintValue(): cannot pass value!
(ROOT::Experimental::TDF::TInterface<TFilterBase> &) ERROR in cling::executePrintValue(): missing value string.

which confused me and led me to believe that it was actually an error in the Filter and not just the printing…

But good to know that it actually works and just looks like it doesn’t :slight_smile:

Alright, please ignore the error message for now (or append a ; to all relevant lines at prompt) – it will go away soon.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.