filter acts as put
Hi @johnkerl, if write this wrong filter command
echo "a=0" | mlr filter '$a=10'
I get a=10.
I know the filter is wrong, I must use == and not =, however, I think that filter verb should never change the contents of cells.
Am I wrong?
Thank you
Correct, filter acts as put and the difference is just whether the final statement is used as a boolean to decide whether or not to forward the curent record
https://miller.readthedocs.io/en/6.13.0/reference-dsl/#differences-between-put-and-filter
Correct,
filteracts asputand the difference is just whether the final statement is used as a boolean to decide whether or not to forward the curent record
Okay, so if I understand you, this should not happen and this is a bug. Am I wrong?
I guess I can assert that the final filter expression does evaluate to bool and abort the program if it doesn't -- ?
I guess I can assert that the final
filterexpression does evaluate tobooland abort the program if it doesn't -- ?
John, I am too basic a user and don't understand you all the time 😢
What I expected in a case like this was to have the same input content in the output, because the filter cannot filter anything out. Or for mlr to fail and exit, because the syntax is wrong.
Thank you
What I expected in a case like this was to have the same input content in the output, because the filter cannot filter anything out. Or for mlr to fail and exit, because the syntax is wrong.
I guess my question is, which of those two would you prefer? (My "I guess I can assert that the final filter expression does evaluate to bool and abort the program if it doesn't -- ?" is the same as your "Or for mlr to fail and exit, because the syntax is wrong".)
Ok, sorry @johnkerl , I understood you, thank you.
I would rather mlr come out and warn me that the syntax is wrong.