paleolimbot commented on issue #159:
URL: https://github.com/apache/sedona-db/issues/159#issuecomment-3353163125
> How would you expose functions like ST_SetSRID and ST_GeomFromText in an
Ibis-inspired manner?
This is roughly how it works in Ibis:
```python
import ibis
from ibis import _
con = ibis.duckdb.connect()
df = con.sql("SELECT 'one' as one")
df.mutate(foofy=_.one.concat("_two")).preview()
#> ┏━━━━━━━━┳━━━━━━━━━┓
#> ┃ one ┃ foofy ┃
#> ┡━━━━━━━━╇━━━━━━━━━┩
#> │ string │ string │
#> ├────────┼─────────┤
#> │ one │ one_two │
#> └────────┴─────────┘
```
In other words, the `concat()` function is exposed as an attribute on the
column. The autocomplete here is not great...in the datafusion Python bindings
it's more like `datafusion.col("one").concat("_other stuff")`. The PySpark way
would be `import sedona.db.functions as st; st.concat(col("one"),
lit("_two"))`, which is very SQLy and not all that interesting to me. The
autocomplete for that version is OK though since `st.<tab>` gives you a nice
list and `st.concat(` pops up a helpful description + arguments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]