Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cosmos] make response_hook thread safe for the sync client #33790

Merged
merged 28 commits into from
Jan 25, 2024

Conversation

simorenoh
Copy link
Member

@simorenoh simorenoh commented Jan 10, 2024

This PR ensures that the use of response_hook by users is utilizing thread-safe headers as opposed to client_connection.last_response_headers for the sync client.

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-cosmos

@simorenoh simorenoh changed the title [Cosmos] make response_hook thread safe [Cosmos] make response_hook thread safe sync client Jan 15, 2024
@simorenoh simorenoh changed the title [Cosmos] make response_hook thread safe sync client [Cosmos] make response_hook thread safe for the sync client Jan 15, 2024
@simorenoh simorenoh marked this pull request as ready for review January 17, 2024 16:11
@simorenoh simorenoh requested a review from annatisch January 18, 2024 23:47
Copy link
Member

@annatisch annatisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thank you!

@simorenoh simorenoh merged commit 27316b3 into Azure:main Jan 25, 2024
16 checks passed
@simorenoh simorenoh deleted the thread-safe-headers branch January 25, 2024 16:55
sofiar-msft pushed a commit to sofiar-msft/azure-sdk-for-python that referenced this pull request Feb 16, 2024
)

* only missing queries

* pylint

* upsert method typehints

* Update _cosmos_client_connection.py

* had to include List in return type for batch

* Revert "had to include List in return type for batch"

This reverts commit cacf629.

* read all items is also query - still don't have this logic down

* casting batch

* casting again?

* oops

* return readItems to previous state

* remove casting in client_connection Batch

* update __queryFeed to be thread safe

* forgot to save headers

* Update _cosmos_client_connection.py

* typehint for non-used method was missing

* Updated User operations

* make response_hook internal in cosmos_client

* make response_hook internal in database

* make response_hook internal container

* small fixes

* Update database.py

* Update _cosmos_client_connection.py

* fixes from comments

* wrong naming on these samples pls let me squeeze it in <3

* revert changes on cosmos_client methods

* Update cosmos_client.py

---------

Co-authored-by: antisch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants