From 3be19ccc37ad6cd866b53bd4dd9be3fb7da39766 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:19:09 -0400 Subject: [PATCH 1/5] test: add test case --- ibis/expr/tests/test_newrels.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ibis/expr/tests/test_newrels.py b/ibis/expr/tests/test_newrels.py index e92def62957e..d8fd44a39c01 100644 --- a/ibis/expr/tests/test_newrels.py +++ b/ibis/expr/tests/test_newrels.py @@ -1748,3 +1748,19 @@ def test_filters_are_allowed_to_have_the_same_name(): assert f1.equals(f2) assert f1.equals(f3) assert f1.equals(f4) + + +def test_projections_with_similar_expressions_have_different_names(): + t = ibis.table({"a": "string", "b": "string"}, name="t") + + a = t.a.fill_null("") + b = t.b.fill_null("") + assert a.op().name != b.op().name + + expr = t.select(a, b) + fields = expr.op().fields + + assert a.op().name in fields + assert b.op().name in fields + + assert expr.schema() == ibis.schema({a.op().name: "string", b.op().name: "string"}) From 178e197833c1a75e1f6482f5604a286cd5d2634e Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 30 Jun 2024 07:27:31 -0400 Subject: [PATCH 2/5] fix(ir): construct variadic names as tuples --- ibis/expr/operations/core.py | 19 +++- ibis/expr/operations/structs.py | 7 ++ ibis/expr/types/arrays.py | 78 ++++++++-------- ibis/expr/types/generic.py | 158 ++++++++++++++++---------------- ibis/expr/types/strings.py | 86 ++++++++--------- ibis/expr/types/structs.py | 18 ++-- 6 files changed, 191 insertions(+), 175 deletions(-) diff --git a/ibis/expr/operations/core.py b/ibis/expr/operations/core.py index 0bad2ae4b71c..98d5a3c3c116 100644 --- a/ibis/expr/operations/core.py +++ b/ibis/expr/operations/core.py @@ -14,6 +14,7 @@ from ibis.common.grounds import Concrete from ibis.common.patterns import Coercible, CoercionError from ibis.common.typing import DefaultTypeVars +from ibis.util import is_iterable @public @@ -79,11 +80,19 @@ def __coerce__( # TODO(kszucs): figure out how to represent not named arguments @property def name(self) -> str: - names = ( - name - for arg in self.__args__ - if (name := getattr(arg, "name", None)) is not None - ) + names = [] + for arg in self.__args__: + if is_iterable(arg): + elements = [ + element_name + for element in arg + if (element_name := getattr(element, "name", None)) is not None + ] + joined = ", ".join(elements) + fmt = "({})" if len(elements) != 1 else "({},)" + names.append(fmt.format(joined)) + elif (name := getattr(arg, "name", None)) is not None: + names.append(name) return f"{self.__class__.__name__}({', '.join(names)})" @property diff --git a/ibis/expr/operations/structs.py b/ibis/expr/operations/structs.py index 3e921cdd633c..5b24f2aeb911 100644 --- a/ibis/expr/operations/structs.py +++ b/ibis/expr/operations/structs.py @@ -48,6 +48,13 @@ def __init__(self, names, values): ) super().__init__(names=names, values=values) + @property + def name(self) -> str: + pairs = ", ".join( + f"{name!r}: {op.name}" for name, op in zip(self.names, self.values) + ) + return f"{self.__class__.__name__}({{{pairs}}})" + @attribute def dtype(self) -> dt.DataType: dtypes = (value.dtype for value in self.values) diff --git a/ibis/expr/types/arrays.py b/ibis/expr/types/arrays.py index 2053bc47d87d..092341984ecd 100644 --- a/ibis/expr/types/arrays.py +++ b/ibis/expr/types/arrays.py @@ -179,7 +179,7 @@ def concat(self, other: ArrayValue, *args: ArrayValue) -> ArrayValue: └──────────────────────┘ >>> t.a.concat(t.a) ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ ArrayConcat() ┃ + ┃ ArrayConcat((a, a)) ┃ ┡━━━━━━━━━━━━━━━━━━━━━━┩ │ array │ ├──────────────────────┤ @@ -188,38 +188,38 @@ def concat(self, other: ArrayValue, *args: ArrayValue) -> ArrayValue: │ NULL │ └──────────────────────┘ >>> t.a.concat(ibis.literal([4], type="array")) - ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ ArrayConcat() ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━┩ - │ array │ - ├──────────────────────┤ - │ [7, 4] │ - │ [3, 4] │ - │ [4] │ - └──────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ ArrayConcat((a, (4,))) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ array │ + ├────────────────────────┤ + │ [7, 4] │ + │ [3, 4] │ + │ [4] │ + └────────────────────────┘ `concat` is also available using the `+` operator >>> [1] + t.a - ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ ArrayConcat() ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━┩ - │ array │ - ├──────────────────────┤ - │ [1, 7] │ - │ [1, 3] │ - │ [1] │ - └──────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ ArrayConcat(((1,), a)) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ array │ + ├────────────────────────┤ + │ [1, 7] │ + │ [1, 3] │ + │ [1] │ + └────────────────────────┘ >>> t.a + [1] - ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ ArrayConcat() ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━┩ - │ array │ - ├──────────────────────┤ - │ [7, 1] │ - │ [3, 1] │ - │ [1] │ - └──────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ ArrayConcat((a, (1,))) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ array │ + ├────────────────────────┤ + │ [7, 1] │ + │ [3, 1] │ + │ [1] │ + └────────────────────────┘ """ return ops.ArrayConcat((self, other, *args)).to_expr() @@ -950,7 +950,7 @@ def zip(self, other: ArrayValue, *others: ArrayValue) -> ArrayValue: └──────────────────────┴──────────────────────┘ >>> t.numbers.zip(t.strings) ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ ArrayZip() ┃ + ┃ ArrayZip((numbers, strings)) ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ array> │ ├───────────────────────────────────────────────┤ @@ -1105,7 +1105,7 @@ def array(values: Iterable[V]) -> ArrayValue: >>> t = ibis.memtable({"a": [1, 2, 3], "b": [4, 5, 6]}) >>> ibis.array([t.a, 42, ibis.literal(None)]) ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ Array() ┃ + ┃ Array((a, 42, None)) ┃ ┡━━━━━━━━━━━━━━━━━━━━━━┩ │ array │ ├──────────────────────┤ @@ -1115,14 +1115,14 @@ def array(values: Iterable[V]) -> ArrayValue: └──────────────────────┘ >>> ibis.array([t.a, 42 + ibis.literal(5)]) - ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ Array() ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━┩ - │ array │ - ├──────────────────────┤ - │ [1, 47] │ - │ [2, 47] │ - │ [3, 47] │ - └──────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ Array((a, Add(5, 42))) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ array │ + ├────────────────────────┤ + │ [1, 47] │ + │ [2, 47] │ + │ [3, 47] │ + └────────────────────────┘ """ return ops.Array(tuple(values)).to_expr() diff --git a/ibis/expr/types/generic.py b/ibis/expr/types/generic.py index 71a95a51a128..9c7fb9e6fe99 100644 --- a/ibis/expr/types/generic.py +++ b/ibis/expr/types/generic.py @@ -541,15 +541,15 @@ def isin(self, values: Value | Sequence[Value]) -> ir.BooleanValue: Check against a literal sequence of values >>> t.a.isin([1, 2]) - ┏━━━━━━━━━━━━━┓ - ┃ InValues(a) ┃ - ┡━━━━━━━━━━━━━┩ - │ boolean │ - ├─────────────┤ - │ True │ - │ True │ - │ False │ - └─────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━┓ + ┃ InValues(a, (1, 2)) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━┩ + │ boolean │ + ├─────────────────────┤ + │ True │ + │ True │ + │ False │ + └─────────────────────┘ Check against a derived expression @@ -582,35 +582,35 @@ def isin(self, values: Value | Sequence[Value]) -> ir.BooleanValue: >>> t = ibis.memtable({"x": [1, 2]}) >>> t.x.isin([1, None]) - ┏━━━━━━━━━━━━━┓ - ┃ InValues(x) ┃ - ┡━━━━━━━━━━━━━┩ - │ boolean │ - ├─────────────┤ - │ True │ - │ NULL │ - └─────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ InValues(x, (1, None)) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ boolean │ + ├────────────────────────┤ + │ True │ + │ NULL │ + └────────────────────────┘ >>> t = ibis.memtable({"x": [1, None, 2]}) >>> t.x.isin([1]) - ┏━━━━━━━━━━━━━┓ - ┃ InValues(x) ┃ - ┡━━━━━━━━━━━━━┩ - │ boolean │ - ├─────────────┤ - │ True │ - │ NULL │ - │ False │ - └─────────────┘ + ┏━━━━━━━━━━━━━━━━━━━┓ + ┃ InValues(x, (1,)) ┃ + ┡━━━━━━━━━━━━━━━━━━━┩ + │ boolean │ + ├───────────────────┤ + │ True │ + │ NULL │ + │ False │ + └───────────────────┘ >>> t.x.isin([3]) - ┏━━━━━━━━━━━━━┓ - ┃ InValues(x) ┃ - ┡━━━━━━━━━━━━━┩ - │ boolean │ - ├─────────────┤ - │ False │ - │ NULL │ - │ False │ - └─────────────┘ + ┏━━━━━━━━━━━━━━━━━━━┓ + ┃ InValues(x, (3,)) ┃ + ┡━━━━━━━━━━━━━━━━━━━┩ + │ boolean │ + ├───────────────────┤ + │ False │ + │ NULL │ + │ False │ + └───────────────────┘ """ from ibis.expr.types import ArrayValue @@ -654,17 +654,17 @@ def notin(self, values: Value | Sequence[Value]) -> ir.BooleanValue: │ 19.3 │ └───────────────┘ >>> t.bill_depth_mm.notin([18.7, 18.1]) - ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ Not(InValues(bill_depth_mm)) ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ - │ boolean │ - ├──────────────────────────────┤ - │ False │ - │ True │ - │ True │ - │ NULL │ - │ True │ - └──────────────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ Not(InValues(bill_depth_mm, (18.7, 18.1))) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ boolean │ + ├────────────────────────────────────────────┤ + │ False │ + │ True │ + │ True │ + │ NULL │ + │ True │ + └────────────────────────────────────────────┘ """ return ~self.isin(values) @@ -906,47 +906,47 @@ def case(self) -> bl.SimpleCaseBuilder: │ female │ └────────┘ >>> x.case().when("male", "M").when("female", "F").else_("U").end() - ┏━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ SimpleCase(sex, 'U') ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━┩ - │ string │ - ├──────────────────────┤ - │ M │ - │ F │ - │ F │ - │ U │ - │ F │ - └──────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ SimpleCase(sex, ('male', 'female'), ('M', 'F'), 'U') ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├──────────────────────────────────────────────────────┤ + │ M │ + │ F │ + │ F │ + │ U │ + │ F │ + └──────────────────────────────────────────────────────┘ Cases not given result in the ELSE case >>> x.case().when("male", "M").else_("OTHER").end() - ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ SimpleCase(sex, 'OTHER') ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━━━━━┩ - │ string │ - ├──────────────────────────┤ - │ M │ - │ OTHER │ - │ OTHER │ - │ OTHER │ - │ OTHER │ - └──────────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ SimpleCase(sex, ('male',), ('M',), 'OTHER') ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├─────────────────────────────────────────────┤ + │ M │ + │ OTHER │ + │ OTHER │ + │ OTHER │ + │ OTHER │ + └─────────────────────────────────────────────┘ If you don't supply an ELSE, then NULL is used >>> x.case().when("male", "M").end() - ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ SimpleCase(sex, Cast(None, string)) ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ - │ string │ - ├─────────────────────────────────────┤ - │ M │ - │ NULL │ - │ NULL │ - │ NULL │ - │ NULL │ - └─────────────────────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ SimpleCase(sex, ('male',), ('M',), Cast(None, string)) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├────────────────────────────────────────────────────────┤ + │ M │ + │ NULL │ + │ NULL │ + │ NULL │ + │ NULL │ + └────────────────────────────────────────────────────────┘ """ import ibis.expr.builders as bl diff --git a/ibis/expr/types/strings.py b/ibis/expr/types/strings.py index 3b6c26196ea0..2e9e3b640453 100644 --- a/ibis/expr/types/strings.py +++ b/ibis/expr/types/strings.py @@ -1538,23 +1538,23 @@ def concat(self, other: str | StringValue, *args: str | StringValue) -> StringVa >>> ibis.options.interactive = True >>> t = ibis.memtable({"s": ["abc", None]}) >>> t.s.concat("xyz", "123") - ┏━━━━━━━━━━━━━━━━┓ - ┃ StringConcat() ┃ - ┡━━━━━━━━━━━━━━━━┩ - │ string │ - ├────────────────┤ - │ abcxyz123 │ - │ NULL │ - └────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ StringConcat((s, 'xyz', '123')) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├─────────────────────────────────┤ + │ abcxyz123 │ + │ NULL │ + └─────────────────────────────────┘ >>> t.s + "xyz" - ┏━━━━━━━━━━━━━━━━┓ - ┃ StringConcat() ┃ - ┡━━━━━━━━━━━━━━━━┩ - │ string │ - ├────────────────┤ - │ abcxyz │ - │ NULL │ - └────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ StringConcat((s, 'xyz')) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├──────────────────────────┤ + │ abcxyz │ + │ NULL │ + └──────────────────────────┘ """ return ops.StringConcat((self, other, *args)).to_expr() @@ -1587,25 +1587,25 @@ def __add__(self, other: str | StringValue) -> StringValue: │ bca │ └────────┘ >>> t.s + "z" - ┏━━━━━━━━━━━━━━━━┓ - ┃ StringConcat() ┃ - ┡━━━━━━━━━━━━━━━━┩ - │ string │ - ├────────────────┤ - │ abcz │ - │ bacz │ - │ bcaz │ - └────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ StringConcat((s, 'z')) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├────────────────────────┤ + │ abcz │ + │ bacz │ + │ bcaz │ + └────────────────────────┘ >>> t.s + t.s - ┏━━━━━━━━━━━━━━━━┓ - ┃ StringConcat() ┃ - ┡━━━━━━━━━━━━━━━━┩ - │ string │ - ├────────────────┤ - │ abcabc │ - │ bacbac │ - │ bcabca │ - └────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ StringConcat((s, s)) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├──────────────────────┤ + │ abcabc │ + │ bacbac │ + │ bcabca │ + └──────────────────────┘ """ return self.concat(other) @@ -1638,15 +1638,15 @@ def __radd__(self, other: str | StringValue) -> StringValue: │ bca │ └────────┘ >>> "z" + t.s - ┏━━━━━━━━━━━━━━━━┓ - ┃ StringConcat() ┃ - ┡━━━━━━━━━━━━━━━━┩ - │ string │ - ├────────────────┤ - │ zabc │ - │ zbac │ - │ zbca │ - └────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ StringConcat(('z', s)) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ string │ + ├────────────────────────┤ + │ zabc │ + │ zbac │ + │ zbca │ + └────────────────────────┘ """ return ops.StringConcat((other, self)).to_expr() diff --git a/ibis/expr/types/structs.py b/ibis/expr/types/structs.py index 7de4c2845190..6b23ed4f30d1 100644 --- a/ibis/expr/types/structs.py +++ b/ibis/expr/types/structs.py @@ -67,15 +67,15 @@ def struct( >>> t = ibis.memtable({"a": [1, 2, 3]}) >>> ibis.struct([("a", t.a), ("b", "foo")]) - ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ - ┃ StructColumn() ┃ - ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ - │ struct │ - ├─────────────────────────────┤ - │ {'a': 1, 'b': 'foo'} │ - │ {'a': 2, 'b': 'foo'} │ - │ {'a': 3, 'b': 'foo'} │ - └─────────────────────────────┘ + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ StructColumn({'a': a, 'b': 'foo'}) ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ + │ struct │ + ├────────────────────────────────────┤ + │ {'a': 1, 'b': 'foo'} │ + │ {'a': 2, 'b': 'foo'} │ + │ {'a': 3, 'b': 'foo'} │ + └────────────────────────────────────┘ """ import ibis.expr.operations as ops From 85252c1de5aad9b087d44449569ecfb26d408fc3 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 30 Jun 2024 07:35:37 -0400 Subject: [PATCH 3/5] chore(sql): regen snapshots --- .../snapshots/test_compiler/test_to_timestamp_timezone/out.sql | 2 +- .../tests/snapshots/test_functions/test_greatest_least/out1.sql | 2 +- .../tests/snapshots/test_functions/test_greatest_least/out2.sql | 2 +- .../tests/snapshots/test_functions/test_greatest_least/out3.sql | 2 +- .../tests/snapshots/test_functions/test_greatest_least/out4.sql | 2 +- .../test_functions/test_string_column_find_in_set/out.sql | 2 +- .../tests/snapshots/test_operators/test_search_case/out.sql | 2 +- .../tests/snapshots/test_operators/test_simple_case/out.sql | 2 +- .../test_bucket_to_case/close_extreme_false/out.sql | 2 +- .../close_extreme_false_closed_right/out.sql | 2 +- .../close_extreme_false_include_under_include_over/out.sql | 2 +- .../test_bucket_to_case/closed_right/out.sql | 2 +- .../closed_right_close_extreme_false_include_under/out.sql | 2 +- .../closed_right_include_over_include_under/out.sql | 2 +- .../test_bucket_histogram/test_bucket_to_case/default/out.sql | 2 +- .../test_bucket_to_case/include_over_include_under0/out.sql | 2 +- .../test_bucket_to_case/include_over_include_under1/out.sql | 2 +- .../test_bucket_to_case/include_over_include_under2/out.sql | 2 +- .../test_bucket_to_case/include_under/out.sql | 2 +- .../test_bucket_to_case/include_under_include_over/out.sql | 2 +- .../fill_null_l_extendedprice/out.sql | 2 +- .../fill_null_l_extendedprice_double/out.sql | 2 +- .../fill_null_l_quantity/out.sql | 2 +- .../tests/snapshots/test_case_exprs/test_search_case/out.sql | 2 +- .../tests/snapshots/test_case_exprs/test_simple_case/out.sql | 2 +- .../test_varargs_functions/coalesce_columns/out.sql | 2 +- .../test_varargs_functions/coalesce_scalar/out.sql | 2 +- .../test_varargs_functions/greatest_columns/out.sql | 2 +- .../test_varargs_functions/greatest_scalar/out.sql | 2 +- .../test_varargs_functions/least_columns/out.sql | 2 +- .../test_varargs_functions/least_scalar/out.sql | 2 +- .../test_in_not_in/test_field_in_literals/isin/out.sql | 2 +- .../test_in_not_in/test_field_in_literals/notin/out.sql | 2 +- .../test_in_not_in/test_literal_in_fields/isin/out.sql | 2 +- .../test_in_not_in/test_literal_in_fields/notin/out.sql | 2 +- .../test_string_builtins/find_in_set_multiple/out.sql | 2 +- .../test_string_builtins/find_in_set_single/out.sql | 2 +- .../snapshots/test_string_builtins/test_string_join/out.sql | 2 +- .../test_numeric_unary_builtins/double_col-zero_ifnull/out.sql | 2 +- .../test_numeric_unary_builtins/int_col-zero_ifnull/out.sql | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql index 3e79c2e21179..0a958c9e7f90 100644 --- a/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql +++ b/ibis/backends/bigquery/tests/unit/snapshots/test_compiler/test_to_timestamp_timezone/out.sql @@ -1,3 +1,3 @@ SELECT - parse_timestamp('%F %Z', CONCAT(`t0`.`date_string_col`, ' America/New_York'), 'UTC') AS `StringToTimestamp_StringConcat_'%F %Z'` + parse_timestamp('%F %Z', CONCAT(`t0`.`date_string_col`, ' America/New_York'), 'UTC') AS `StringToTimestamp_StringConcat_date_string_col_' America_New_York'_'%F %Z'` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql index ceb370f312cc..78f06fa478ea 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out1.sql @@ -1,3 +1,3 @@ SELECT - GREATEST("t0"."int_col", 10) AS "Greatest()" + GREATEST("t0"."int_col", 10) AS "Greatest((int_col, 10))" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql index 85601ed38dad..3e4d6b84046a 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out2.sql @@ -1,3 +1,3 @@ SELECT - GREATEST("t0"."int_col", "t0"."bigint_col") AS "Greatest()" + GREATEST("t0"."int_col", "t0"."bigint_col") AS "Greatest((int_col, bigint_col))" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql index 3dc8affe7d89..634d65266108 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out3.sql @@ -1,3 +1,3 @@ SELECT - LEAST("t0"."int_col", 10) AS "Least()" + LEAST("t0"."int_col", 10) AS "Least((int_col, 10))" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql index 4f57aa348d16..c9c52a4ab713 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_greatest_least/out4.sql @@ -1,3 +1,3 @@ SELECT - LEAST("t0"."int_col", "t0"."bigint_col") AS "Least()" + LEAST("t0"."int_col", "t0"."bigint_col") AS "Least((int_col, bigint_col))" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql index d00ed4908b72..1517de613b95 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_functions/test_string_column_find_in_set/out.sql @@ -1,3 +1,3 @@ SELECT - indexOf(['a','b','c'], "t0"."string_col") - 1 AS "FindInSet(string_col)" + indexOf(['a','b','c'], "t0"."string_col") - 1 AS "FindInSet(string_col, ('a', 'b', 'c'))" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql index 11569fc15843..d0805b4ca8e6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_search_case/out.sql @@ -5,5 +5,5 @@ SELECT WHEN "t0"."float_col" < 0 THEN "t0"."int_col" ELSE 0 - END AS "SearchedCase(0)" + END AS "SearchedCase((Greater(float_col, 0), Less(float_col, 0)), (Multiply(int_col, 2), int_col), 0)" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql index 66d7aca5a83f..78d80bb4acc6 100644 --- a/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql +++ b/ibis/backends/clickhouse/tests/snapshots/test_operators/test_simple_case/out.sql @@ -1,3 +1,3 @@ SELECT - CASE "t0"."string_col" WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS "SimpleCase(string_col, 'default')" + CASE "t0"."string_col" WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS "SimpleCase(string_col, ('foo', 'baz'), ('bar', 'qux'), 'default')" FROM "functional_alltypes" AS "t0" \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false/out.sql index 461a8aa9f242..5ff5a71e04ab 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false/out.sql @@ -19,5 +19,5 @@ SELECT ) THEN 2 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_closed_right/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_closed_right/out.sql index 06537d8a9463..29da4b5df0c5 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_closed_right/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_closed_right/out.sql @@ -19,5 +19,5 @@ SELECT ) THEN 2 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_include_under_include_over/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_include_under_include_over/out.sql index b4aa949c85a5..ebe6bc778751 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_include_under_include_over/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/close_extreme_false_include_under_include_over/out.sql @@ -23,5 +23,5 @@ SELECT WHEN 50 <= `t0`.`f` THEN 4 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right/out.sql index cf3f70f2d673..f032ce6adc79 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right/out.sql @@ -19,5 +19,5 @@ SELECT ) THEN 2 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_close_extreme_false_include_under/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_close_extreme_false_include_under/out.sql index d59ea7900f17..daeeb597272e 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_close_extreme_false_include_under/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_close_extreme_false_include_under/out.sql @@ -21,5 +21,5 @@ SELECT ) THEN 3 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_include_over_include_under/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_include_over_include_under/out.sql index b0f5158c750d..32dd402e95f8 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_include_over_include_under/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/closed_right_include_over_include_under/out.sql @@ -5,5 +5,5 @@ SELECT WHEN 10 < `t0`.`f` THEN 1 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/default/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/default/out.sql index c9ab2234f883..33d919eb0275 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/default/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/default/out.sql @@ -19,5 +19,5 @@ SELECT ) THEN 2 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under0/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under0/out.sql index e6e63f334c08..7f40c6c03899 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under0/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under0/out.sql @@ -5,5 +5,5 @@ SELECT WHEN 10 <= `t0`.`f` THEN 1 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under1/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under1/out.sql index 104dcc83014a..ffd04b93d7d8 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under1/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under1/out.sql @@ -5,5 +5,5 @@ SELECT WHEN 10 <= `t0`.`f` THEN 1 ELSE CAST(NULL AS TINYINT) - END AS INT) AS `Cast(Bucket(f), int32)` + END AS INT) AS `Cast(Bucket(f, ()), int32)` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under2/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under2/out.sql index f4661b51024a..3bbb662cd0b6 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under2/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_over_include_under2/out.sql @@ -5,5 +5,5 @@ SELECT WHEN 10 <= `t0`.`f` THEN 1 ELSE CAST(NULL AS TINYINT) - END AS DOUBLE) AS `Cast(Bucket(f), float64)` + END AS DOUBLE) AS `Cast(Bucket(f, ()), float64)` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under/out.sql index 39a83640fe1b..ddfaa467d794 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under/out.sql @@ -21,5 +21,5 @@ SELECT ) THEN 3 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under_include_over/out.sql b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under_include_over/out.sql index 0dda250e0ef1..9b270497abae 100644 --- a/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under_include_over/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_bucket_histogram/test_bucket_to_case/include_under_include_over/out.sql @@ -23,5 +23,5 @@ SELECT WHEN 50 < `t0`.`f` THEN 4 ELSE CAST(NULL AS TINYINT) - END AS `Bucket(f)` + END AS `Bucket(f, ())` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice/out.sql b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice/out.sql index 4890dcc7d096..db94d5cf777f 100644 --- a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`l_extendedprice`, 0) AS `Coalesce()` + COALESCE(`t0`.`l_extendedprice`, 0) AS `Coalesce((l_extendedprice, 0))` FROM `tpch_lineitem` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice_double/out.sql b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice_double/out.sql index 59bd466502bc..59106ffcfc2a 100644 --- a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice_double/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_extendedprice_double/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`l_extendedprice`, 0.0) AS `Coalesce()` + COALESCE(`t0`.`l_extendedprice`, 0.0) AS `Coalesce((l_extendedprice, 0.0))` FROM `tpch_lineitem` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_quantity/out.sql b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_quantity/out.sql index 3fa2c6486406..4d27dbaf75eb 100644 --- a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_quantity/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_decimal_fill_null_cast_arg/fill_null_l_quantity/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`l_quantity`, 0) AS `Coalesce()` + COALESCE(`t0`.`l_quantity`, 0) AS `Coalesce((l_quantity, 0))` FROM `tpch_lineitem` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_search_case/out.sql b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_search_case/out.sql index 086867ecdd77..5120543c4e64 100644 --- a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_search_case/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_search_case/out.sql @@ -5,5 +5,5 @@ SELECT WHEN `t0`.`c` < 0 THEN `t0`.`a` * 2 ELSE CAST(NULL AS BIGINT) - END AS `SearchedCase(Cast(None, int64))` + END AS `SearchedCase((Greater(f, 0), Less(c, 0)), (Multiply(d, 2), Multiply(a, 2)), Cast(None, int64))` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_simple_case/out.sql b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_simple_case/out.sql index bb9300299c72..efb410f97840 100644 --- a/ibis/backends/impala/tests/snapshots/test_case_exprs/test_simple_case/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_case_exprs/test_simple_case/out.sql @@ -1,3 +1,3 @@ SELECT - CASE `t0`.`g` WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS `SimpleCase(g, 'default')` + CASE `t0`.`g` WHEN 'foo' THEN 'bar' WHEN 'baz' THEN 'qux' ELSE 'default' END AS `SimpleCase(g, ('foo', 'baz'), ('bar', 'qux'), 'default')` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_columns/out.sql b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_columns/out.sql index 37a2675f2b39..417ca0b9fd85 100644 --- a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_columns/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_columns/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`int_col`, `t0`.`bigint_col`) AS `Coalesce()` + COALESCE(`t0`.`int_col`, `t0`.`bigint_col`) AS `Coalesce((int_col, bigint_col))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_scalar/out.sql b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_scalar/out.sql index d0f093f98b7a..e9047dd974e4 100644 --- a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_scalar/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/coalesce_scalar/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`string_col`, 'foo') AS `Coalesce()` + COALESCE(`t0`.`string_col`, 'foo') AS `Coalesce((string_col, 'foo'))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_columns/out.sql b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_columns/out.sql index d667c8a69296..613aacf8df99 100644 --- a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_columns/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_columns/out.sql @@ -1,3 +1,3 @@ SELECT - GREATEST(`t0`.`int_col`, `t0`.`bigint_col`) AS `Greatest()` + GREATEST(`t0`.`int_col`, `t0`.`bigint_col`) AS `Greatest((int_col, bigint_col))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_scalar/out.sql b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_scalar/out.sql index 693db916250b..90198678b75c 100644 --- a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_scalar/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/greatest_scalar/out.sql @@ -1,3 +1,3 @@ SELECT - GREATEST(`t0`.`string_col`, 'foo') AS `Greatest()` + GREATEST(`t0`.`string_col`, 'foo') AS `Greatest((string_col, 'foo'))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_columns/out.sql b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_columns/out.sql index 90f4b2d35f1c..d48a4af6094b 100644 --- a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_columns/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_columns/out.sql @@ -1,3 +1,3 @@ SELECT - LEAST(`t0`.`int_col`, `t0`.`bigint_col`) AS `Least()` + LEAST(`t0`.`int_col`, `t0`.`bigint_col`) AS `Least((int_col, bigint_col))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_scalar/out.sql b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_scalar/out.sql index 8260947a866e..0d4757e05243 100644 --- a/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_scalar/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_coalesce_greater_least/test_varargs_functions/least_scalar/out.sql @@ -1,3 +1,3 @@ SELECT - LEAST(`t0`.`string_col`, 'foo') AS `Least()` + LEAST(`t0`.`string_col`, 'foo') AS `Least((string_col, 'foo'))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/isin/out.sql b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/isin/out.sql index d0c44759597f..769b1e5d4c9c 100644 --- a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/isin/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/isin/out.sql @@ -1,3 +1,3 @@ SELECT - `t0`.`g` IN ('foo', 'bar', 'baz') AS `InValues(g)` + `t0`.`g` IN ('foo', 'bar', 'baz') AS `InValues(g, ('foo', 'bar', 'baz'))` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/notin/out.sql b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/notin/out.sql index 1962710dd06e..46d5203a6744 100644 --- a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/notin/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_field_in_literals/notin/out.sql @@ -1,5 +1,5 @@ SELECT NOT ( `t0`.`g` IN ('foo', 'bar', 'baz') - ) AS `Not(InValues(g))` + ) AS `Not(InValues(g, ('foo', 'bar', 'baz')))` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/isin/out.sql b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/isin/out.sql index 5e82e8ab1e24..266fb99d1546 100644 --- a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/isin/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/isin/out.sql @@ -1,3 +1,3 @@ SELECT - 2 IN (`t0`.`a`, `t0`.`b`, `t0`.`c`) AS `InValues(2)` + 2 IN (`t0`.`a`, `t0`.`b`, `t0`.`c`) AS `InValues(2, (a, b, c))` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/notin/out.sql b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/notin/out.sql index 5eb7de11190a..027462be7482 100644 --- a/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/notin/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_in_not_in/test_literal_in_fields/notin/out.sql @@ -1,5 +1,5 @@ SELECT NOT ( 2 IN (`t0`.`a`, `t0`.`b`, `t0`.`c`) - ) AS `Not(InValues(2))` + ) AS `Not(InValues(2, (a, b, c)))` FROM `alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_multiple/out.sql b/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_multiple/out.sql index 614cf9e0c23c..79cd81f715f1 100644 --- a/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_multiple/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_multiple/out.sql @@ -1,3 +1,3 @@ SELECT - FIND_IN_SET(`t0`.`string_col`, CONCAT_WS(',', 'a', 'b')) - 1 AS `FindInSet(string_col)` + FIND_IN_SET(`t0`.`string_col`, CONCAT_WS(',', 'a', 'b')) - 1 AS `FindInSet(string_col, ('a', 'b'))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_single/out.sql b/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_single/out.sql index 1affe459d9a1..7c91d1c7a0e1 100644 --- a/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_single/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_builtins/find_in_set_single/out.sql @@ -1,3 +1,3 @@ SELECT - FIND_IN_SET(`t0`.`string_col`, CONCAT_WS(',', 'a')) - 1 AS `FindInSet(string_col)` + FIND_IN_SET(`t0`.`string_col`, CONCAT_WS(',', 'a')) - 1 AS `FindInSet(string_col, ('a',))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_join/out.sql b/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_join/out.sql index 495885e4d146..b02acfd501ab 100644 --- a/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_join/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_string_builtins/test_string_join/out.sql @@ -1,2 +1,2 @@ SELECT - CONCAT_WS(',', 'a', 'b') AS `StringJoin(',')` \ No newline at end of file + CONCAT_WS(',', 'a', 'b') AS `StringJoin(('a', 'b'), ',')` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/double_col-zero_ifnull/out.sql b/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/double_col-zero_ifnull/out.sql index 50332619efc8..3981ea70292a 100644 --- a/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/double_col-zero_ifnull/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/double_col-zero_ifnull/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`double_col`, 0) AS `Coalesce()` + COALESCE(`t0`.`double_col`, 0) AS `Coalesce((double_col, 0))` FROM `functional_alltypes` AS `t0` \ No newline at end of file diff --git a/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/int_col-zero_ifnull/out.sql b/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/int_col-zero_ifnull/out.sql index 98cd6d13641f..b434baa9c235 100644 --- a/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/int_col-zero_ifnull/out.sql +++ b/ibis/backends/impala/tests/snapshots/test_unary_builtins/test_numeric_unary_builtins/int_col-zero_ifnull/out.sql @@ -1,3 +1,3 @@ SELECT - COALESCE(`t0`.`int_col`, 0) AS `Coalesce()` + COALESCE(`t0`.`int_col`, 0) AS `Coalesce((int_col, 0))` FROM `functional_alltypes` AS `t0` \ No newline at end of file From d52142d062a289a9a3e7e73b1ec5d074798f2d9b Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 30 Jun 2024 08:29:51 -0400 Subject: [PATCH 4/5] test(postgres): fix tests --- ibis/backends/postgres/tests/test_functions.py | 3 +-- ibis/backends/risingwave/tests/test_functions.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ibis/backends/postgres/tests/test_functions.py b/ibis/backends/postgres/tests/test_functions.py index 93467491a3d4..8d66ff90e800 100644 --- a/ibis/backends/postgres/tests/test_functions.py +++ b/ibis/backends/postgres/tests/test_functions.py @@ -384,8 +384,7 @@ def test_coalesce_all_na_double(con): def test_numeric_builtins_work(alltypes, df): expr = alltypes.double_col.fill_null(0) result = expr.execute() - expected = df.double_col.fillna(0) - expected.name = "Coalesce()" + expected = df.double_col.fillna(0).rename(expr.get_name()) tm.assert_series_equal(result, expected) diff --git a/ibis/backends/risingwave/tests/test_functions.py b/ibis/backends/risingwave/tests/test_functions.py index 89c012e7f026..48550824022a 100644 --- a/ibis/backends/risingwave/tests/test_functions.py +++ b/ibis/backends/risingwave/tests/test_functions.py @@ -215,8 +215,7 @@ def test_coalesce_all_na_double(con): def test_numeric_builtins_work(alltypes, df): expr = alltypes.double_col.fill_null(0) result = expr.execute() - expected = df.double_col.fillna(0) - expected.name = "Coalesce()" + expected = df.double_col.fillna(0).rename(expr.get_name()) tm.assert_series_equal(result, expected) From 3cfeec330d588b8f3c501ff9c839a5236f0cbbdc Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:45:48 -0400 Subject: [PATCH 5/5] test(bigquery): add test for complex column name --- ibis/backends/bigquery/tests/system/test_client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ibis/backends/bigquery/tests/system/test_client.py b/ibis/backends/bigquery/tests/system/test_client.py index af3cdbe940d9..3a73315b8fb0 100644 --- a/ibis/backends/bigquery/tests/system/test_client.py +++ b/ibis/backends/bigquery/tests/system/test_client.py @@ -436,3 +436,11 @@ def test_parameters_in_url_connect(mocker): parsed = urlparse("bigquery://ibis-gbq?location=us-east1") ibis.connect("bigquery://ibis-gbq?location=us-east1") spy.assert_called_once_with(parsed, location="us-east1") + + +def test_complex_column_name(con): + expr = ibis.literal(1).name( + "StringToTimestamp_StringConcat_date_string_col_' America_New_York'_'%F %Z'" + ) + result = con.to_pandas(expr) + assert result == 1