Closed jeffbrainerd closed 1 month ago
Hey @jeffbrainerd -- if you upgrade to Ibis 9.0, this is implemented (the operations matrix is usually reflective of our main
branch or the latest release).
[ins] In [1]: import ibis
...:
...: t = ibis.table(dict(one="date", two="date"), name="example")
...: tt = t.filter(t.one.delta(t.two, "year") > 10)
...: ibis.to_sql(tt, dialect="postgres")
Out[1]:
SELECT
*
FROM "example" AS "t0"
WHERE
CAST(EXTRACT(year FROM AGE(CAST("t0"."one" AS TIMESTAMP), CAST("t0"."two" AS TIMESTAMP))) AS BIGINT) > 10
That's good news, thank you @gforsyth .
What happened?
Executing the following code,
I received an error:
No translation rule for <class 'ibis.expr.operations.temporal.DateDelta'>
I expected this to work for Postgres based on the Support Matrix for DateDelta. The code works fine for DuckDB (the only other backend I tried).
I definitely appreciate any action or workarounds for this. Thank you!
What version of ibis are you using?
8.0.0
What backend(s) are you using, if any?
Postgres
Relevant log output
Code of Conduct