Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

added encoding to document_client #123

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pydocumentdb/document_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

"""Document client class for the Azure Cosmos DB database service.
"""
# coding=utf-8

import requests

Expand Down Expand Up @@ -927,7 +928,7 @@ def CreateDocument(self, database_or_collection_link, document, options=None):
dict

"""
# Pythons 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/
Expand Down Expand Up @@ -965,7 +966,7 @@ def UpsertDocument(self, database_or_collection_link, document, options=None):
dict

"""
# Pythons 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/
Expand Down Expand Up @@ -1560,7 +1561,7 @@ def ReplaceDocument(self, document_link, new_document, options=None):
path = base.GetPathFromLink(document_link)
document_id = base.GetResourceIdOrFullNameFromLink(document_link)

# Pythons 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/
Expand Down Expand Up @@ -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)
self.session.update_session(response_result, response_headers)