Serialize unbound expression without connecting to backend? #10140
-
👋 I'm exploring the use of ibis as a query generation tool where the actual queries are run remotely (not in the current Python environment). I'm looking at ibis because it's friendlier than end users writing SQL and because in the long term I'd like to use substrait for query transmission. In the short term I would use DuckDB with SQL text transmission, but in the longer term switch to DataFusion with substrait transmission. I want to keep the Python environment small and not require dependencies only used for execution. I'd like to serialize the ibis expression to a DuckDB-flavor SQL string, but ideally not require duckdb as a dependency in Python, because the SQL text would be copied to run in DuckDB manually. Are there some sort of low-level APIs that would enable this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You're in luck, there are actually high-level APIs for this 😄, and they work with and without any backend dependencies installed. You can call |
Beta Was this translation helpful? Give feedback.
You're in luck, there are actually high-level APIs for this 😄, and they work with and without any backend dependencies installed.
You can call
ibis.to_sql(some_expr, dialect="a valid dialect, like duckdb")
without any particular extras installed, e.g.,pip install ibis-framework
.