From 15d259cc6a7a84b3aa33e20e18b62244a38f569b Mon Sep 17 00:00:00 2001 From: geriamir Date: Wed, 30 May 2018 11:46:40 +0300 Subject: [PATCH] added encoding to document_client --- pydocumentdb/document_client.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pydocumentdb/document_client.py b/pydocumentdb/document_client.py index fb3f5d8..ec9a58d 100644 --- a/pydocumentdb/document_client.py +++ b/pydocumentdb/document_client.py @@ -21,6 +21,7 @@ """Document client class for the Azure Cosmos DB database service. """ +# coding=utf-8 import requests @@ -927,7 +928,7 @@ def CreateDocument(self, database_or_collection_link, document, options=None): dict """ - # Python’s default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby). + # Python's default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby). # This means that if you use a mutable default argument and mutate it, you will and have mutated that object for all future calls to the function as well. # So, using a non-mutable deafult in this case(None) and assigning an empty dict(mutable) inside the method # For more details on this gotcha, please refer http://docs.python-guide.org/en/latest/writing/gotchas/ @@ -965,7 +966,7 @@ def UpsertDocument(self, database_or_collection_link, document, options=None): dict """ - # Python’s default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby). + # Python's default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby). # This means that if you use a mutable default argument and mutate it, you will and have mutated that object for all future calls to the function as well. # So, using a non-mutable deafult in this case(None) and assigning an empty dict(mutable) inside the method # For more details on this gotcha, please refer http://docs.python-guide.org/en/latest/writing/gotchas/ @@ -1560,7 +1561,7 @@ def ReplaceDocument(self, document_link, new_document, options=None): path = base.GetPathFromLink(document_link) document_id = base.GetResourceIdOrFullNameFromLink(document_link) - # Python’s default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby). + # Python's default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby). # This means that if you use a mutable default argument and mutate it, you will and have mutated that object for all future calls to the function as well. # So, using a non-mutable deafult in this case(None) and assigning an empty dict(mutable) inside the function so that it remains local # For more details on this gotcha, please refer http://docs.python-guide.org/en/latest/writing/gotchas/ @@ -2847,4 +2848,4 @@ def _UpdateSessionIfRequired(self, request_headers, response_result, response_he if is_session_consistency: # update session - self.session.update_session(response_result, response_headers) \ No newline at end of file + self.session.update_session(response_result, response_headers)