Skip to content

Commit 3ab3312

Browse files
committed
renamed Type to PipelineDataType
1 parent bebb39a commit 3ab3312

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _to_pb(self) -> Value:
159159
)
160160

161161

162-
class Type(str, Enum):
162+
class PipelineDataType(str, Enum):
163163
"""Enumeration of the different types generated by the Firestore backend."""
164164

165165
NULL = "null"
@@ -2503,7 +2503,7 @@ def type(self) -> "Expression":
25032503
return FunctionExpression("type", [self])
25042504

25052505
@expose_as_static
2506-
def is_type(self, type_val: Type | str | Expression) -> "BooleanExpression":
2506+
def is_type(self, type_val: PipelineDataType | str | Expression) -> "BooleanExpression":
25072507
"""Creates an expression that checks if the result is of the specified type.
25082508
25092509
Example:

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,16 +1947,16 @@ def test_is_type(self):
19471947
assert infix_instance == instance
19481948

19491949
def test_type_enum(self):
1950-
from google.cloud.firestore_v1.pipeline_expressions import Type
1950+
from google.cloud.firestore_v1.pipeline_expressions import PipelineDataType
19511951

19521952
arg1 = self._make_arg("Value")
1953-
instance = Expression.is_type(arg1, Type.STRING)
1953+
instance = Expression.is_type(arg1, PipelineDataType.STRING)
19541954
assert instance.name == "is_type"
19551955
assert instance.params[0] == arg1
19561956
assert isinstance(instance.params[1], Constant)
1957-
assert instance.params[1].value == Type.STRING.value
1957+
assert instance.params[1].value == PipelineDataType.STRING.value
19581958
assert repr(instance) == "Value.is_type(Constant.of('string'))"
1959-
infix_instance = arg1.is_type(Type.STRING)
1959+
infix_instance = arg1.is_type(PipelineDataType.STRING)
19601960
assert infix_instance == instance
19611961

19621962
def test_timestamp_enums(self):

0 commit comments

Comments
 (0)