Skip to content

Commit 3220697

Browse files
[Storage] Fix Empty Headers in File Share and Data Lake (Azure#23796)
1 parent 72da32f commit 3220697

12 files changed

+713
-670
lines changed

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_serialize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def convert_datetime_to_rfc1123(date):
4545

4646
def add_metadata_headers(metadata=None):
4747
# type: (Optional[Dict[str, str]]) -> str
48+
if not metadata:
49+
return None
4850
headers = list()
4951
if metadata:
5052
for key, value in metadata.items():

sdk/storage/azure-storage-file-datalake/tests/recordings/test_file.test_create_file.yaml

Lines changed: 102 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,88 +3,152 @@ interactions:
33
body: null
44
headers:
55
Accept:
6-
- '*/*'
6+
- application/xml
77
Accept-Encoding:
88
- gzip, deflate
99
Connection:
1010
- keep-alive
1111
Content-Length:
1212
- '0'
1313
User-Agent:
14-
- azsdk-python-storage-dfs/12.0.0b1 Python/3.7.3 (Windows-10-10.0.18362-SP0)
15-
x-ms-client-request-id:
16-
- d4973a7a-ff4f-11e9-b0b3-001a7dda7113
14+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
1715
x-ms-date:
18-
- Mon, 04 Nov 2019 22:09:54 GMT
19-
x-ms-properties:
20-
- ''
16+
- Fri, 01 Apr 2022 21:28:41 GMT
2117
x-ms-version:
22-
- '2019-02-02'
18+
- '2020-10-02'
2319
method: PUT
24-
uri: https://storagename.dfs.core.windows.net/filesystem8e670a80/directory8e670a80?resource=directory
20+
uri: https://storagename.blob.core.windows.net/filesystem8e670a80?restype=container&timeout=5
2521
response:
2622
body:
2723
string: ''
2824
headers:
25+
content-length:
26+
- '0'
27+
date:
28+
- Fri, 01 Apr 2022 21:28:40 GMT
29+
etag:
30+
- '"0x8DA142697785900"'
31+
last-modified:
32+
- Fri, 01 Apr 2022 21:28:40 GMT
33+
server:
34+
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
35+
x-ms-version:
36+
- '2020-10-02'
37+
status:
38+
code: 201
39+
message: Created
40+
- request:
41+
body: null
42+
headers:
43+
Accept:
44+
- application/json
45+
Accept-Encoding:
46+
- gzip, deflate
47+
Connection:
48+
- keep-alive
2949
Content-Length:
3050
- '0'
31-
Date:
32-
- Mon, 04 Nov 2019 22:09:54 GMT
33-
ETag:
34-
- '"0x8D76173B8F086E9"'
35-
Last-Modified:
36-
- Mon, 04 Nov 2019 22:09:54 GMT
37-
Server:
51+
User-Agent:
52+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
53+
x-ms-date:
54+
- Fri, 01 Apr 2022 21:28:41 GMT
55+
x-ms-version:
56+
- '2020-10-02'
57+
method: PUT
58+
uri: https://storagename.dfs.core.windows.net/filesystem8e670a80/directory8e670a80?resource=directory
59+
response:
60+
body:
61+
string: ''
62+
headers:
63+
content-length:
64+
- '0'
65+
date:
66+
- Fri, 01 Apr 2022 21:28:41 GMT
67+
etag:
68+
- '"0x8DA142697EE3285"'
69+
last-modified:
70+
- Fri, 01 Apr 2022 21:28:41 GMT
71+
server:
3872
- Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
39-
x-ms-request-id:
40-
- 5e64d340-701f-0005-0f5c-939f4f000000
73+
x-ms-request-server-encrypted:
74+
- 'true'
4175
x-ms-version:
42-
- '2019-02-02'
76+
- '2020-10-02'
4377
status:
4478
code: 201
4579
message: Created
4680
- request:
4781
body: null
4882
headers:
4983
Accept:
50-
- '*/*'
84+
- application/json
5185
Accept-Encoding:
5286
- gzip, deflate
5387
Connection:
5488
- keep-alive
5589
Content-Length:
5690
- '0'
5791
User-Agent:
58-
- azsdk-python-storage-dfs/12.0.0b1 Python/3.7.3 (Windows-10-10.0.18362-SP0)
59-
x-ms-client-request-id:
60-
- d4c4e086-ff4f-11e9-aa83-001a7dda7113
92+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
6193
x-ms-date:
62-
- Mon, 04 Nov 2019 22:09:54 GMT
63-
x-ms-properties:
64-
- ''
94+
- Fri, 01 Apr 2022 21:28:42 GMT
6595
x-ms-version:
66-
- '2019-02-02'
96+
- '2020-10-02'
6797
method: PUT
6898
uri: https://storagename.dfs.core.windows.net/filesystem8e670a80/directory8e670a80%2Ffilename?resource=file
6999
response:
70100
body:
71101
string: ''
72102
headers:
73-
Content-Length:
103+
content-length:
74104
- '0'
75-
Date:
76-
- Mon, 04 Nov 2019 22:09:54 GMT
77-
ETag:
78-
- '"0x8D76173B900C670"'
79-
Last-Modified:
80-
- Mon, 04 Nov 2019 22:09:54 GMT
81-
Server:
105+
date:
106+
- Fri, 01 Apr 2022 21:28:41 GMT
107+
etag:
108+
- '"0x8DA142697FBEC26"'
109+
last-modified:
110+
- Fri, 01 Apr 2022 21:28:41 GMT
111+
server:
82112
- Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
83-
x-ms-request-id:
84-
- 5e64d341-701f-0005-105c-939f4f000000
113+
x-ms-request-server-encrypted:
114+
- 'true'
85115
x-ms-version:
86-
- '2019-02-02'
116+
- '2020-10-02'
87117
status:
88118
code: 201
89119
message: Created
120+
- request:
121+
body: null
122+
headers:
123+
Accept:
124+
- application/xml
125+
Accept-Encoding:
126+
- gzip, deflate
127+
Connection:
128+
- keep-alive
129+
Content-Length:
130+
- '0'
131+
User-Agent:
132+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
133+
x-ms-date:
134+
- Fri, 01 Apr 2022 21:28:42 GMT
135+
x-ms-version:
136+
- '2020-10-02'
137+
method: DELETE
138+
uri: https://storagename.blob.core.windows.net/filesystem8e670a80?restype=container
139+
response:
140+
body:
141+
string: ''
142+
headers:
143+
content-length:
144+
- '0'
145+
date:
146+
- Fri, 01 Apr 2022 21:28:41 GMT
147+
server:
148+
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
149+
x-ms-version:
150+
- '2020-10-02'
151+
status:
152+
code: 202
153+
message: Accepted
90154
version: 1

0 commit comments

Comments
 (0)