-
Notifications
You must be signed in to change notification settings - Fork 216
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
standard functions sometimes can't be used after the as
function
#3127
Comments
as
as
function
Interestingly,
works. It's |
Good find. And to note, adding parentheses doesn't help: from tab
select col1 = ((col1 | as int) + 1)
|
It seems that only prql/crates/prql-compiler/src/semantic/std.prql Lines 18 to 23 in fe4edca
|
I have looked at this and it seems that allowing prql/crates/prql-compiler/src/tests/test_error_messages.rs Lines 175 to 190 in fe4edca
|
So the main difference is that there are constraints on types for
Meaning So the question is : should we write If not, a clean fix needs to be found to allow |
I would tend towards "fewer false positives, even if that means fewer false negatives" — particularly for instances where there's no escape hatch. So I'm +0.2 on this. @aljazerzen understands it much better, so if he has a view, it likely outweighs mine... |
If the right fix is hard to implement I'm also in favor of a quick fix to allow valid syntax. |
So, the problem here is that:
Problem 1 is a missing feature, since
This will take a bit of time and it also depends on inference of types of columns in relations, which I working on right now. Problem 2 is not really a problem, it is expected behavior. Re a quick fix: in this case an error is very inconvenient, so the quick fix of removing type annotation in std module seems a reasonable thing to do. They can easily be added back later. If we do that, make sure to add a test for this case. |
What happened?
From https://github.com/eitsupi/querying-with-prql/blob/4acff8fa395a9a2c33cad15ed61866dabac25157/docs/method_chaining.qmd#L128-L158
I rewrote the example that worked in PRQL 0.8 with the 0.9 syntax and an error occurred.
For example, the following minimal example will result in the following error:
PRQL input
SQL output
Expected SQL output
MVCE confirmation
Anything else?
No response
The text was updated successfully, but these errors were encountered: