3030# -----------------------------------------------------------------------------
3131
3232from typing import Any , Optional , Union
33+ from typing_extensions import Self
3334import json
3435
3536from . import errors
@@ -519,7 +520,7 @@ def count(self) -> int:
519520 """
520521 return self ._collection ._impl .get_count (self )
521522
522- def fetchArraySize (self , value : int ) -> "SodaOperation" :
523+ def fetchArraySize (self , value : int ) -> Self :
523524 """
524525 This is a tuning method to specify the number of documents that are
525526 internally fetched in batches by calls to
@@ -543,7 +544,7 @@ def fetchArraySize(self, value: int) -> "SodaOperation":
543544 self ._fetch_array_size = value
544545 return self
545546
546- def filter (self , value : Union [dict , str ]) -> "SodaOperation" :
547+ def filter (self , value : Union [dict , str ]) -> Self :
547548 """
548549 Sets a filter specification for complex document queries and ordering
549550 of JSON documents. Filter specifications must be provided as a
@@ -585,7 +586,7 @@ def getOne(self) -> Union["SodaDocument", None]:
585586 if doc_impl is not None :
586587 return SodaDocument ._from_impl (doc_impl )
587588
588- def hint (self , value : str ) -> "SodaOperation" :
589+ def hint (self , value : str ) -> Self :
589590 """
590591 Specifies a hint that will be provided to the SODA operation when it is
591592 performed. This is expected to be a string in the same format as SQL
@@ -603,7 +604,7 @@ def hint(self, value: str) -> "SodaOperation":
603604 self ._hint = value
604605 return self
605606
606- def lock (self ) -> "SodaOperation" :
607+ def lock (self ) -> Self :
607608 """
608609 Specifies whether the documents fetched from the collection should be
609610 locked (equivalent to SQL "select for update"). Use of this method
@@ -628,7 +629,7 @@ def lock(self) -> "SodaOperation":
628629 self ._lock = True
629630 return self
630631
631- def key (self , value : str ) -> "SodaOperation" :
632+ def key (self , value : str ) -> Self :
632633 """
633634 Specifies that the document with the specified key should be returned.
634635 This causes any previous calls made to this method and
@@ -643,7 +644,7 @@ def key(self, value: str) -> "SodaOperation":
643644 self ._keys = None
644645 return self
645646
646- def keys (self , value : list ) -> "SodaOperation" :
647+ def keys (self , value : list ) -> Self :
647648 """
648649 Specifies that documents that match the keys found in the supplied
649650 sequence should be returned. This causes any previous calls made to
@@ -660,7 +661,7 @@ def keys(self, value: list) -> "SodaOperation":
660661 self ._key = None
661662 return self
662663
663- def limit (self , value : int ) -> "SodaOperation" :
664+ def limit (self , value : int ) -> Self :
664665 """
665666 Specifies that only the specified number of documents should be
666667 returned. This method is only usable for read operations such as
@@ -711,7 +712,7 @@ def replaceOneAndGet(self, doc: Any) -> "SodaDocument":
711712 )
712713 return SodaDocument ._from_impl (return_doc_impl )
713714
714- def skip (self , value : int ) -> "SodaOperation" :
715+ def skip (self , value : int ) -> Self :
715716 """
716717 Specifies the number of documents that match the other criteria that
717718 will be skipped. This method is only usable for read operations such as
@@ -727,7 +728,7 @@ def skip(self, value: int) -> "SodaOperation":
727728 self ._skip = value
728729 return self
729730
730- def version (self , value : str ) -> "SodaOperation" :
731+ def version (self , value : str ) -> Self :
731732 """
732733 Specifies that documents with the specified version should be returned.
733734 Typically this is used with :meth:`~SodaOperation.key()` to implement
0 commit comments