The verbs build a sentence and check nothing. Whether a column exists, whether an aggregation belongs where you put it, whether the types agree: all of that is answered in one place. So both languages get the same answer, in the same words.
Error:
!
illegal: there is no column called `reveune`. Did you mean `revenue`? The table has: date, region, product, quantity, revenue, cost
|
2 | then keep where ([reveune] > 100)
| ^^^^^^^
try: collect(sales >> keep(col.reveune >100))except GodError as refusal:print(refusal)
illegal: there is no column called `reveune`. Did you mean `revenue`? The table has: date, region, product, quantity, revenue, cost
|
2 | then keep where ([reveune] > 100)
| ^^^^^^^
The whole pipeline is read before any of it runs, so a mistake at step two is reported as a mistake at step two rather than partway through the work.
Because the reading happens before anything runs, a sentence that will not run can still be drawn, as far as the reading got.
sales |>summarize(total =total(revenue), by = region) |>keep(product =="Widget") |>show_steps()
show_steps(sales>> summarize(total = total(col.revenue), by = col.region)>> keep(col.product =="Widget"))
The message says product is not a column, and it is right. The drawing says where it went: the summarize above took it away, along with everything else that was not grouped by. That is the question a message on its own cannot answer, and it is why the refusal and the drawing belong together.
Not every refusal can work this way. When widen finds two rows wanting the same cell, or a value that giving does not list, that is a fact about the data rather than about the sentence. The grammar reads column names rather than rows, so those refusals arrive while the query runs. The words are still the grammar’s, and they still name what to write instead.