And assuming you aren’t trying to do anything more than the panda’s query command does (which parses very limited expressions, like one above, in the context of data frames).
But sure, in general Python byte code to GPU is hard.
Bigger picture, short lambda expressions would be great in many areas!
For example, the expression _ * 2 (or more verbosely x => x * 2) creates the Scala equivalent of lambda x: x * 2. Using something like that would be nice (here using the _ as in Scala):
dataframe[_.height > 5 & _.weight < 200]
The notion of expressing a function like this becomes quite natural once you’ve used it a few times - it’s an underspecified expression with “holes” in it, which will perform a computation once the holes have been assigned values. Just like a simple function containing one expression (a Python lambda).