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] item operation response includes response headers #35791

Merged
merged 57 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
082893c
adds new response to sync point operations
simorenoh May 28, 2024
b9cd428
Update _cosmos_response.py
simorenoh May 31, 2024
2aeabac
addresses comments, adds query changes
simorenoh Jun 12, 2024
b92e5e1
added logic to deal with unpacking of actual values
simorenoh Jun 13, 2024
5dc41ae
pylint
simorenoh Jun 13, 2024
2712393
async changes
simorenoh Jun 19, 2024
f65766a
Update CHANGELOG.md
simorenoh Jun 19, 2024
ee8cb4c
samples using last_response_headers
simorenoh Jun 19, 2024
fc29c3a
Merge branch 'main' into package-response-headers
simorenoh Jul 23, 2024
fb312fd
Merge branch 'main' into package-response-headers
simorenoh Jul 31, 2024
a32dccc
update use of last_response_headers, sanity check on responses
simorenoh Aug 1, 2024
bcf8891
add header tests
simorenoh Aug 1, 2024
f4b74da
readme and oopsies
simorenoh Aug 1, 2024
7fa1aa0
test fixes
simorenoh Aug 2, 2024
7ddb79b
Update sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_responses.py
simorenoh Aug 2, 2024
ba9f6d1
Update sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_responses.py
simorenoh Aug 2, 2024
070ca5d
typing updates
simorenoh Aug 2, 2024
9eb1c05
pylint
simorenoh Aug 2, 2024
c70e2b3
mypy part1
simorenoh Aug 2, 2024
82a4485
tests
simorenoh Aug 2, 2024
821cc1c
fixes
simorenoh Aug 2, 2024
d9ad4a3
tests
simorenoh Aug 6, 2024
adbab3a
update typehint for mypy
simorenoh Aug 6, 2024
ab96aa1
Revert "update typehint for mypy"
simorenoh Aug 6, 2024
c8dedae
mypy
simorenoh Aug 6, 2024
bee494d
Update _cosmos_client_connection.py
simorenoh Aug 6, 2024
56c6d94
Update _cosmos_client_connection.py
simorenoh Aug 6, 2024
5acd395
Update _cosmos_client_connection.py
simorenoh Aug 6, 2024
4b26173
Merge branch 'main' into package-response-headers
simorenoh Aug 6, 2024
d9d74e8
Update _cosmos_client_connection.py
simorenoh Aug 7, 2024
ce4cfba
Update _cosmos_client_connection_async.py
simorenoh Aug 7, 2024
626e628
Update _cosmos_client_connection_async.py
simorenoh Aug 7, 2024
2693959
Merge branch 'main' into package-response-headers
simorenoh Sep 29, 2024
ad90f72
public surface area changes
simorenoh Sep 29, 2024
e0b5fd2
Merge branch 'main' into package-response-headers
simorenoh Sep 30, 2024
c2c8b47
review updates
simorenoh Oct 1, 2024
02b7a64
Update README.md
simorenoh Oct 1, 2024
f1d0f79
Update README.md
simorenoh Oct 1, 2024
4b05db7
Update container.py
simorenoh Oct 2, 2024
2217c6e
rename responses and update inhertiance typing
simorenoh Oct 2, 2024
ca4ae97
Merge branch 'main' into package-response-headers
simorenoh Oct 4, 2024
9cf7d40
revert subtyping
simorenoh Oct 4, 2024
b34608d
missed empty dict responses
simorenoh Oct 4, 2024
ba785c8
Update test_globaldb.py
simorenoh Oct 5, 2024
539fdc2
simplify query_iterable header logic
simorenoh Oct 6, 2024
137fe60
revert
simorenoh Oct 6, 2024
1527d5d
Merge branch 'main' into package-response-headers
simorenoh Oct 7, 2024
381d760
add subscripts to class definition
simorenoh Oct 8, 2024
c73fb46
try re-adding typehint
simorenoh Oct 8, 2024
3b6e585
revert
simorenoh Oct 8, 2024
361e3e8
specify rtypes
simorenoh Oct 8, 2024
ae4aa8f
Update _cosmos_client_connection.py
simorenoh Oct 8, 2024
98a90ee
remove query changes
simorenoh Oct 15, 2024
a44c059
Update _cosmos_client_connection_async.py
simorenoh Oct 15, 2024
c20c1d4
update rtypes
simorenoh Oct 15, 2024
a414d6b
pylint
simorenoh Oct 15, 2024
f89388c
revert more query stuff
simorenoh Oct 16, 2024
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
Prev Previous commit
Next Next commit
Update README.md
simorenoh committed Oct 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 02b7a64ddb768a7f6d391ea97eb5a7f037f7c143
3 changes: 2 additions & 1 deletion sdk/cosmos/azure-cosmos/README.md
Original file line number Diff line number Diff line change
@@ -488,7 +488,7 @@ operation_headers = operation_response.get_response_headers()
etag_value = operation_headers['etag']
request_charge = operation_headers['x-ms-request-charge']
```
For queries, response headers will be present when using paging only:
For queries, response headers will be present when using paging only - and will only be populated once you start going through your pages:
```python
from azure.cosmos import CosmosClient
import os
@@ -503,6 +503,7 @@ container = database.get_container_client(CONTAINER_NAME)

query_response = container.query_items("select * from c", enable_cross_partition_query=True)
query_pages = query_response.by_page()
empty_headers = query_pages.get_response_headers()
first_page = query_pages.next()
first_page_headers = query_pages.get_response_headers()
etag_value = first_page_headers['etag']