Skip to content

Commit 5119b93

Browse files
krzysztof-kwittcpcloud
authored andcommitted
feat(bigquery): implement ops.Degrees, ops.Radians
1 parent 5495d6d commit 5119b93

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ibis/backends/bigquery/registry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ def _clip(t, op):
546546
ops.Modulus: fixed_arity("MOD", 2),
547547
ops.Sign: unary("SIGN"),
548548
ops.Clip: _clip,
549+
ops.Degrees: lambda t, op: f"(180 * {t.translate(op.arg)} / ACOS(-1))",
550+
ops.Radians: lambda t, op: f"(ACOS(-1) * {t.translate(op.arg)} / 180)",
549551
# Temporal functions
550552
ops.Date: unary("DATE"),
551553
ops.DateFromYMD: fixed_arity("DATE", 3),

ibis/backends/tests/test_numeric.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ def test_isnan_isinf(
163163
L(5.556).radians(),
164164
math.radians(5.556),
165165
id='radians',
166-
marks=pytest.mark.notimpl(["bigquery", "datafusion", "impala"]),
166+
marks=pytest.mark.notimpl(["datafusion", "impala"]),
167167
),
168168
param(
169169
L(5.556).degrees(),
170170
math.degrees(5.556),
171171
id='degrees',
172-
marks=pytest.mark.notimpl(["bigquery", "datafusion", "impala"]),
172+
marks=pytest.mark.notimpl(["datafusion", "impala"]),
173173
),
174174
param(L(11) % 3, 11 % 3, id='mod'),
175175
],

0 commit comments

Comments
 (0)