Skip to content

Commit

Permalink
feat(sqlite): fix impl for missing pi and e functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jan 2, 2023
1 parent fea81c6 commit 24b6d2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ibis/backends/sqlite/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,7 @@ def _string_join(t, op):
ops.BitwiseXor: fixed_arity(sa.func._ibis_sqlite_xor, 2),
ops.BitwiseNot: unary(sa.func._ibis_sqlite_inv),
ops.Where: fixed_arity(sa.func.iif, 3),
ops.Pi: fixed_arity(sa.func._ibis_sqlite_pi, 0),
ops.E: fixed_arity(sa.func._ibis_sqlite_e, 0),
}
)
10 changes: 10 additions & 0 deletions ibis/backends/sqlite/udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ def _ibis_sqlite_inv(x):
return None if x is None else ~x


@udf
def _ibis_sqlite_pi():
return math.pi


@udf
def _ibis_sqlite_e():
return math.e


class _ibis_sqlite_var:
def __init__(self, offset):
self.mean = 0.0
Expand Down

0 comments on commit 24b6d2f

Please sign in to comment.