Comments (2)
Good example and it's encouraging to see you pushing functions like this!
There are definitely a few things up — it obv shouldn't panic there.
Also putting an s-string within the pipeline panics :(
let coalesce_bool = func
val <scalar || null>
-> case [
(s"{val}" | in ["no", "n", "N", "false"]) => false,
]
from [{foo = 1}, {foo = null}]
derive { foo_b = coalesce_bool foo }
For completeness — if I put this in the playground, duckdb doesn't raise an error — does it on your end? Is the error message because of the type of some data that's not there?
let coalesce_bool = func
val <scalar || null>
-> case [
val == null => null,
val == 0 => false,
val == 1 => true,
(val | in ["no", "n", "N", "false"]) => false,
(val | in ["yes", "y", "Y", "true"]) => true,
]
from [{foo = 1}, {foo = null}]
derive { foo_b = coalesce_bool foo }
For a workaround — does an s-string in another transform suffice for the moment?
from [{ a = 1 }]
derive a_ = (s"{a} as VARCHAR")
derive { b = ( a_ | in [2, 3] ) }
from prql.
I have to run now, but quickly -- I can provide some more details later on how I've managed to trigger the underlying situation, but unfortunately an s-string in another transform isn't a great solution because of the way this function is used in other parts of our PRQL.
I'm hoping that the PR that I threw together is a simple solution; it does fix the s-string panic as well.
from prql.
Related Issues (20)
- Add sampling extension support to PRQL HOT 3
- DISTINCT ON does not ensure columns exist HOT 1
- [Docker] the 'cargo' binary ... is not applicable to the '1.77.2-aarch64-unknown-linux-gnu' toolchain HOT 3
- Arrow type system as base for the type system HOT 1
- 'std' panics on lowering HOT 4
- Dev Container: can't run playground or book (can run website) HOT 24
- Incorrect Postgres interval syntax HOT 4
- Query optimization: join prunning and "uniqeness" HOT 3
- Named Unions as function parameters HOT 5
- SQL Editor with 30+ Databases - close to PRQL support HOT 13
- Nightly tests failed HOT 1
- sqlite query generation REGEXP doesn't work. HOT 8
- Nightly tests failed HOT 1
- Call user-defined functions HOT 13
- DevContainer doesn't contain `pre-commit` HOT 3
- Node.js 16 is deprecated - use Node.js 20 HOT 5
- Nightly tests failed HOT 1
- Snap auth seems to have expired HOT 5
- Script for updating version numbers? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prql.