11#------------------------------------------------------------------------------
2- # Copyright (c) 2021, 2022 , Oracle and/or its affiliates.
2+ # Copyright (c) 2021, 2023 , Oracle and/or its affiliates.
33#
44# This software is dual-licensed to you under the Universal Permissive License
55# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
2929# SodaDatabase, SodaCollection, SodaDocument, SodaDocCursor and SodaOperation.
3030#------------------------------------------------------------------------------
3131
32- from typing import Union , List
32+ from typing import Any , Union , List
3333import json
3434
3535from . import connection , errors
@@ -46,7 +46,7 @@ def _from_impl(cls, conn, impl):
4646 db ._impl = impl
4747 return db
4848
49- def _get_content_bytes (self , content : object ) -> bytes :
49+ def _get_content_bytes (self , content : Any ) -> bytes :
5050 """
5151 Internal method used for returning the bytes to store in document
5252 content.
@@ -84,7 +84,7 @@ def createCollection(self, name: str, metadata: Union[str, dict]=None,
8484 collection_impl = self ._impl .create_collection (name , metadata , mapMode )
8585 return SodaCollection ._from_impl (self , collection_impl )
8686
87- def createDocument (self , content : object , key : str = None ,
87+ def createDocument (self , content : Any , key : str = None ,
8888 mediaType : str = "application/json" ) -> "SodaDocument" :
8989 """
9090 Creates a SODA document usable for SODA write operations. You only need
@@ -245,16 +245,15 @@ def insertManyAndGet(self, docs: list, hint: str=None) -> list:
245245 return_docs = True )
246246 return [SodaDocument ._from_impl (i ) for i in return_doc_impls ]
247247
248- def insertOne (self , doc : object ) -> None :
248+ def insertOne (self , doc : Any ) -> None :
249249 """
250250 Inserts a given document into the collection. The input document can be
251251 a dictionary or list or an existing SODA document object.
252252 """
253253 doc_impl = self ._process_doc_arg (doc )
254254 self ._impl .insert_one (doc_impl , hint = None , return_doc = False )
255255
256- def insertOneAndGet (self , doc : object ,
257- hint : str = None ) -> "SodaDocument" :
256+ def insertOneAndGet (self , doc : Any , hint : str = None ) -> "SodaDocument" :
258257 """
259258 Similarly to insertOne() this method inserts a given document into the
260259 collection. The only difference is that it returns a SODA Document
@@ -291,7 +290,7 @@ def name(self) -> str:
291290 """
292291 return self ._impl .name
293292
294- def save (self , doc : object ) -> None :
293+ def save (self , doc : Any ) -> None :
295294 """
296295 Saves a document into the collection. This method is equivalent to
297296 insertOne() except that if client-assigned keys are used, and the
@@ -301,7 +300,7 @@ def save(self, doc: object) -> None:
301300 doc_impl = self ._process_doc_arg (doc )
302301 self ._impl .save (doc_impl , hint = None , return_doc = False )
303302
304- def saveAndGet (self , doc : object , hint : str = None ) -> "SodaDocument" :
303+ def saveAndGet (self , doc : Any , hint : str = None ) -> "SodaDocument" :
305304 """
306305 Saves a document into the collection. This method is equivalent to
307306 insertOneAndGet() except that if client-assigned keys are used, and the
@@ -601,7 +600,7 @@ def remove(self) -> int:
601600 """
602601 return self ._collection ._impl .remove (self )
603602
604- def replaceOne (self , doc : object ) -> bool :
603+ def replaceOne (self , doc : Any ) -> bool :
605604 """
606605 Replaces a single document in the collection with the specified
607606 document. The input document can be a dictionary or list or an existing
@@ -615,7 +614,7 @@ def replaceOne(self, doc: object) -> bool:
615614 return self ._collection ._impl .replace_one (self , doc_impl ,
616615 return_doc = False )
617616
618- def replaceOneAndGet (self , doc : object ) -> "SodaDocument" :
617+ def replaceOneAndGet (self , doc : Any ) -> "SodaDocument" :
619618 """
620619 Similarly to replaceOne(), this method replaces a single document in
621620 the collection with the specified document. The only difference is that
0 commit comments