Skip to content

Commit 98284be

Browse files
committed
gemini comments
1 parent c3eb82c commit 98284be

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

packages/google-cloud-firestore/google/cloud/firestore_v1/pipeline_expressions.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,11 @@ def coalesce(self, *others: Expression | CONSTANT_TYPE) -> "Expression":
11131113
Returns:
11141114
An Expression representing the coalesce operation.
11151115
"""
1116-
args = [self]
1117-
args.extend(
1118-
[Expression._cast_to_expr_or_convert_to_constant(x) for x in others]
1116+
return FunctionExpression(
1117+
"coalesce",
1118+
[self]
1119+
+ [Expression._cast_to_expr_or_convert_to_constant(x) for x in others],
11191120
)
1120-
return FunctionExpression("coalesce", args)
11211121

11221122
@expose_as_static
11231123
def switch_on(
@@ -1141,13 +1141,13 @@ def switch_on(
11411141
*others: Additional alternating conditions and results, optionally followed by a default value.
11421142
11431143
Returns:
1144-
An Expression representing the switchOn operation.
1144+
An Expression representing the "switch_on" operation.
11451145
"""
1146-
args = [self, Expression._cast_to_expr_or_convert_to_constant(result)]
1147-
args.extend(
1148-
[Expression._cast_to_expr_or_convert_to_constant(x) for x in others]
1146+
return FunctionExpression(
1147+
"switch_on",
1148+
[self, Expression._cast_to_expr_or_convert_to_constant(result)]
1149+
+ [Expression._cast_to_expr_or_convert_to_constant(x) for x in others],
11491150
)
1150-
return FunctionExpression("switch_on", args)
11511151

11521152
@expose_as_static
11531153
def storage_size(self) -> "Expression":

packages/google-cloud-firestore/tests/unit/v1/test_pipeline_expressions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,8 @@ def test_array_get(self):
750750
assert instance.name == "array_get"
751751
assert instance.params == [arg1, arg2]
752752
assert repr(instance) == "ArrayField.array_get(Offset)"
753-
infix_istance = arg1.array_get(arg2)
754-
assert infix_istance == instance
753+
infix_instance = arg1.array_get(arg2)
754+
assert infix_instance == instance
755755

756756
def test_offset(self):
757757
arg1 = self._make_arg("ArrayField")
@@ -760,8 +760,8 @@ def test_offset(self):
760760
assert instance.name == "offset"
761761
assert instance.params == [arg1, arg2]
762762
assert repr(instance) == "ArrayField.offset(Offset)"
763-
infix_istance = arg1.offset(arg2)
764-
assert infix_istance == instance
763+
infix_instance = arg1.offset(arg2)
764+
assert infix_instance == instance
765765

766766
def test_array_contains(self):
767767
arg1 = self._make_arg("ArrayField")
@@ -1654,8 +1654,8 @@ def test_array_reverse(self):
16541654
assert instance.name == "array_reverse"
16551655
assert instance.params == [arg1]
16561656
assert repr(instance) == "ArrayField.array_reverse()"
1657-
infix_istance = arg1.array_reverse()
1658-
assert infix_istance == instance
1657+
infix_instance = arg1.array_reverse()
1658+
assert infix_instance == instance
16591659

16601660
def test_array_filter(self):
16611661
arg1 = self._make_arg("ArrayField")

0 commit comments

Comments
 (0)