Skip to content

Commit e7956f4

Browse files
mesejocpcloud
authored andcommitted
fix: add upper _method_overrides in decompile
additionally remove duplicated entry for ops.ExtractMinute resolves #11717
1 parent 8e31490 commit e7956f4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ibis/expr/decompile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
ops.ExtractMicrosecond: "microsecond",
2525
ops.ExtractMillisecond: "millisecond",
2626
ops.ExtractMinute: "minute",
27-
ops.ExtractMinute: "minute",
2827
ops.ExtractMonth: "month",
2928
ops.ExtractQuarter: "quarter",
3029
ops.ExtractSecond: "second",
@@ -38,6 +37,7 @@
3837
ops.StringContains: "contains",
3938
ops.StringSQLILike: "ilike",
4039
ops.StringSQLLike: "like",
40+
ops.Uppercase: "upper",
4141
}
4242

4343

ibis/expr/tests/test_decompile.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,16 @@ def test_view():
8686
def test_distinct():
8787
expr = ibis.table({"x": "int"}, name="t").distinct()
8888
assert "t.distinct()" in decompile(expr)
89+
90+
91+
@pytest.mark.parametrize(
92+
("method", "override"),
93+
[
94+
(ibis._.x.upper(), ".upper()"),
95+
(ibis._.x.lower(), ".lower()"),
96+
(ibis._.y.minute(), ".minute()"),
97+
],
98+
)
99+
def test_method_overrides(method, override):
100+
expr = ibis.table({"x": "string", "y": "timestamp"}, name="t").select(method)
101+
assert override in decompile(expr)

0 commit comments

Comments
 (0)