@@ -314,7 +314,7 @@ def where(self, field_path: str, op_string: str, value) -> "BaseQuery":
314314 )
315315
316316 @staticmethod
317- def _make_order (field_path , direction ) -> Any :
317+ def _make_order (field_path , direction ) -> StructuredQuery . Order :
318318 """Helper for :meth:`order_by`."""
319319 return query .StructuredQuery .Order (
320320 field = query .StructuredQuery .FieldReference (field_path = field_path ),
@@ -394,7 +394,7 @@ def limit(self, count: int) -> "BaseQuery":
394394 all_descendants = self ._all_descendants ,
395395 )
396396
397- def limit_to_last (self , count : int ):
397+ def limit_to_last (self , count : int ) -> "BaseQuery" :
398398 """Limit a query to return the last `count` matching results.
399399 If the current query already has a `limit_to_last`
400400 set, this will override it.
@@ -651,7 +651,7 @@ def end_at(
651651 document_fields_or_snapshot , before = False , start = False
652652 )
653653
654- def _filters_pb (self ) -> Any :
654+ def _filters_pb (self ) -> StructuredQuery . Filter :
655655 """Convert all the filters into a single generic Filter protobuf.
656656
657657 This may be a lone field filter or unary filter, may be a composite
@@ -674,7 +674,7 @@ def _filters_pb(self) -> Any:
674674 return query .StructuredQuery .Filter (composite_filter = composite_filter )
675675
676676 @staticmethod
677- def _normalize_projection (projection ) -> Any :
677+ def _normalize_projection (projection ) -> StructuredQuery . Projection :
678678 """Helper: convert field paths to message."""
679679 if projection is not None :
680680
@@ -836,7 +836,7 @@ def stream(
836836 def on_snapshot (self , callback ) -> NoReturn :
837837 raise NotImplementedError
838838
839- def _comparator (self , doc1 , doc2 ) -> Any :
839+ def _comparator (self , doc1 , doc2 ) -> int :
840840 _orders = self ._orders
841841
842842 # Add implicit sorting by name, using the last specified direction.
@@ -883,7 +883,7 @@ def _comparator(self, doc1, doc2) -> Any:
883883 return 0
884884
885885
886- def _enum_from_op_string (op_string : str ) -> Any :
886+ def _enum_from_op_string (op_string : str ) -> int :
887887 """Convert a string representation of a binary operator to an enum.
888888
889889 These enums come from the protobuf message definition
@@ -926,7 +926,7 @@ def _isnan(value) -> bool:
926926 return False
927927
928928
929- def _enum_from_direction (direction : str ) -> Any :
929+ def _enum_from_direction (direction : str ) -> int :
930930 """Convert a string representation of a direction to an enum.
931931
932932 Args:
@@ -954,7 +954,7 @@ def _enum_from_direction(direction: str) -> Any:
954954 raise ValueError (msg )
955955
956956
957- def _filter_pb (field_or_unary ) -> Any :
957+ def _filter_pb (field_or_unary ) -> StructuredQuery . Filter :
958958 """Convert a specific protobuf filter to the generic filter type.
959959
960960 Args:
0 commit comments