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

If match headers #13315

Merged
merged 9 commits into from
Sep 2, 2020
2 changes: 2 additions & 0 deletions sdk/tables/azure-data-tables/azure/data/tables/_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def _get_match_headers(kwargs, match_param, etag_param):
raise ValueError("'{}' specified without '{}'.".format(match_param, etag_param))
elif match_condition == MatchConditions.IfMissing:
if_none_match = '*'
elif match_condition == MatchConditions.Unconditionally:
if_none_match = '*'
elif match_condition is None:
if kwargs.get(etag_param):
raise ValueError("'{}' specified without '{}'.".format(etag_param, match_param))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def delete_entity(
if_match, _ = _get_match_headers(kwargs=dict(kwargs, etag=kwargs.pop('etag', None),
match_condition=kwargs.pop('match_condition', None)),
etag_param='etag', match_param='match_condition')

try:
self._client.table.delete_entity(
table=self.table_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,49 @@ interactions:
status:
code: 204
message: No Content
- request:
body: null
headers:
Accept:
- application/json;odata=minimalmetadata
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
DataServiceVersion:
- '3.0'
Date:
- Tue, 25 Aug 2020 15:09:34 GMT
User-Agent:
- azsdk-python-data-tables/2019-07-07 Python/3.8.4 (Windows-10-10.0.19041-SP0)
x-ms-date:
- Tue, 25 Aug 2020 15:09:34 GMT
x-ms-version:
- '2019-07-07'
method: GET
uri: https://storagename.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147')
response:
body:
string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The
specified resource does not exist.\nRequestId:32d896fc-f002-0081-26f1-7abf70000000\nTime:2020-08-25T15:09:35.2385928Z"}}}'
headers:
cache-control:
- no-cache
content-type:
- application/json;odata=minimalmetadata;streaming=true;charset=utf-8
date:
- Tue, 25 Aug 2020 15:09:34 GMT
server:
- Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
transfer-encoding:
- chunked
x-content-type-options:
- nosniff
x-ms-version:
- '2019-07-07'
status:
code: 404
message: Not Found
- request:
body: null
headers:
Expand Down
Loading