prql icon indicating copy to clipboard operation
prql copied to clipboard

'std' panics on lowering

Open m-span opened this issue 1 year ago • 5 comments
trafficstars

What happened?

trying to compile just std leads to program panic

PRQL input

std

SQL output

The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: prqlc/prqlc/src/semantic/lowering.rs:227

Expected SQL output

n/a

MVCE confirmation

  • [X] Minimal example
  • [X] New issue

Anything else?

Interestingly enough, if std is later in a pipeline, it errors out appropriately

Error:
   ╭─[:1:10]
   │
 1 │ from a | std
   │          ─┬─
   │           ╰─── expected a function, but found `std`
───╯

m-span avatar May 15 '24 15:05 m-span

This feels similar to #4317 - I'm going to see whats up here

m-span avatar May 16 '24 17:05 m-span

This message should rather say "current implementation of the resolver is half-assed, this should fail earlier, with a better error message".

I'm working on rewriting it all, but I wonder if my new version will cover this case too.

In any case, thanks for the report, this is useful and will be fixed, maybe long time in the future.

aljazerzen avatar May 16 '24 18:05 aljazerzen

FWIW something that replaced the panic with an error of type Bug would be a welcome contribution!

max-sixty avatar May 30 '24 16:05 max-sixty

#4538 created to temporarily prevent crash

now this input returns: Error: internal compiler error; tracked at https://github.com/PRQL/prql/issues/4474

m-span avatar Jun 05 '24 03:06 m-span

i have related issue. On this prql code:

from `math`
select c

i expect this sql

select c from "math"

but got this error Error: internal compiler error; tracked at https://github.com/PRQL/prql/issues/4474

korbash avatar Feb 05 '25 06:02 korbash