-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail fast and print error to console #1106
Comments
@honzajde I've felt the same for a while. Since Miller was first created I've realized there are a few different ways to handle errors in data:
All of these three modes are legitimate and all have times they might be desired. But I have not yet made error-handling configurable. So the most I've ever done is pick which of the three modes to be the default -- the first one -- and implement only that. I still think the first mode is a legit default -- people deal with lots of dirty data and I don't want the default behavior to be "crash the program". But as you rightly point out, when people do want a "crash the program" option, they should be able to get it. Currently they cannot. :( |
@johnkerl I understand the default choice in error handling and I mostly appreciate it. On the other hand, sometimes I work with data that is messy and I don't know it's shape up-front and I get to a situation when I see an error in the result and I know this is one of those "data vs assumptions" bugs, where seeing the failing case means everything. Apart from failing fast:
|
I am also surprised that this compiles:
And it should not.... And maybe (hopefully!) my last question, why Miller does not have BTW. Miller DSL is really neat, I would just wish it had everything like a programming language;) Thanks for all this work, anyways! |
That's just it ... the expression is syntactically OK; the Miller DSL is not strongly typed so it "compiles" (parses into a concrete syntax tree);
I felt like a full implementation of
Indeed! 😁 There's a bit more here: A note on the complexity of Miller's expression language. Originally I had the choice to maybe embed Lua or something as a DSL language, but ultimately chose to start a language from scratch one feature at a time. There weren't even for-loops until Miller 4. Miller 5 was a big jump featurewise getting the Miller DSL closer to a full-blown programming language -- but there's a lot I don't want to do ever do like classes, modules, etc etc -- it would be better to embed an existing language, than to grow the Miller DSL that far -- existing full-blown languages do a much better job of being full-blown programming languages. I do think though that aiming for the level of what
You're welcome! :) In summary: options 2 & 3 for error-handling and a |
But
Actually, I should have asked rather about
You also mention
Miller is doing more then |
I have been using this tool for a while but still I am not sure what is the best way to debug failing DSL expression. Issue is that the program is running like nothing happens only difference is
(error)
in a particular column and row.I want to know what is that error.
What am I missing?
mlr help
does not helpmlr help find
does not helpmlr -v
mlr --verbose
deso not help (I was hoping it has a verbose mode)As per https://miller.readthedocs.io/en/latest/reference-dsl-errors/
dump
andprint
do not help me since it fails on an operationThere is perhaps a way to print en error's message when it's in place of column value - that could help...
However, It would be much easier to call
mlr --fail-fast ...
and see immediatelly.The text was updated successfully, but these errors were encountered: