Having been using OpenRefine for several years now, I have long since learned to ignore the "From" column of the History tab in the custom facet creation window since it never says anything other than "This project", even though many or all of the expressions in the list come from other projects. But now I'm wondering if this is a problem with my system (I only use MacOs, currently 14.3, and I'm currently using OR 3.7.7) or if this is a feature that was never fully implemented. I would certainly find it helpful to be able to relate the expressions to their respective projects.
I think...
Was never implemented at the Project level. (To be stored in the project's metadata.json
file).
Instead it's a listing of the top 100 (last?) GREL operations from any project (currently logged and stored in the workspace.json
file as TopList).
Actually, I can't even tell WHEN LogExpressionCommand
is ever used.
Because I don't understand what commit
means in this if condition
Should I log a bug issue?
@tfmorris Thoughts on this one?
IMHO commit
is a boolean flag to control whether the executed command should get logged or not.
The function getExpression
is consistently called with the flag commit
set to true
in the JavaScript codebase in OpenRefine.
AFAIK such flag arguments are considered code smells and should get refactored.
I just happen to be figuring out all the OpenRefine commands right now, and I know of at least one usage instance for LogExpressionCommand
: when the user executes a custom text transform on a column. An example POST request to /command/core/log-expression
includes:
Query string parameters:
project: 2429803265249
Form data:
expression: grel:value.replace('.csv', '')
csrf_token: XocsQ17GfkxghDmMLrlfcLiyyqyBmMmy
I think this is something that broke somewhere along the line - I believe it working in earlier versions of OpenRefine - I do remember it working (although my memory isn't always 100% reliable). Looking at the code changes my guess it was working in 2.x but possibly broke in 3.0 or 3.1
I think this is a bug that should be fixed @jquartel if you are willing to go ahead a file one
Having been using OpenRefine for several years now, I have long since learned to ignore the "From" column of the History tab in the custom facet creation window since it never says anything other than "This project", even though many or all of the expressions in the list come from other projects. But now I'm wondering if this is a problem with my system (I only use MacOs, currently 14.3, and I'm currently using OR 3.7.7) or if this is a feature that was never fully implemented.
Global and local expression histories were implemented in Mar 2010. Project metadata has had somewhat of a tortured existence with some large scale commits and subsequent reversions. Local expression histories were broken by this giant (56 K LoC!) commit in 2018 which I can't make heads or tails out of. There was an attempt to revert it later, but, unfortunately, a combination of intervening commits and the conflict resolution process caused the revert to be incomplete. If you look at the before and after versions of LogExpressionCommand, you can see that the line which saves the expression to the local project metadata got dropped. So, yes, it's a bug which was introduced 6 years ago. Creating an issue in the issue tracker will get it on the radar to get fixed. There's more machinery involved which may have gotten lost as well, so I suspect that it'll be more than just a one line fix.
Tom
p.s. The phrase "This project" is controlled by a "global" flag which is never set. If global=true, it'll say "Other project." But it's misleading, because the history is only global currently, not per-project.