File tree Expand file tree Collapse file tree
packages/google-cloud-firestore
google/cloud/firestore_v1 Expand file tree Collapse file tree Original file line number Diff line number Diff 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:
Original file line number Diff line number Diff 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 ):
You can’t perform that action at this time.
0 commit comments