kaskada-ai / kaskada

Modern, open-source event-processing
https://kaskada.io/
Apache License 2.0
351 stars 15 forks source link

Implement `json` in new python client #768

Open epinzur opened 1 year ago

epinzur commented 1 year ago

I tried to implement json but ran into issues, because there was no way to work with the fenl jsonobject type in python.

I tried accessing accessing properties of the object using col("name"), .name, and ["name"]. None worked.

json().col("a") gives TypeError: Cannot access column 'a' of non-record type 'None'

a = json_str.json()["a"] gives TypeError: Cannot index into None

I also tried implementing json_field() instead, but only got back null for objects.

We should figure out how to implement a json handler in the new code. Or maybe doing it with a UDF is sufficient for now.