Skip to content

Commit 6580b27

Browse files
[Storage] Fixed parsing of path_name and file_system_name in async clients (Azure#23854)
1 parent 451c63a commit 6580b27

11 files changed

+458
-9
lines changed

sdk/storage/azure-storage-file-datalake/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Bugs Fixed
88
- Updated `create_file_system()` docstring to have the correct return-type of `None`
9+
- Fixed parsing of extra `/` symbols not being stripped properly in `async` clients
910

1011
## 12.6.0 (2022-03-08)
1112

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ def __init__(
9191
**kwargs)
9292
# to override the class field _container_client sync version
9393
kwargs.pop('_hosts', None)
94-
self._container_client = ContainerClient(self._blob_account_url, file_system_name,
94+
self._container_client = ContainerClient(self._blob_account_url, self.file_system_name,
9595
credential=credential,
9696
_hosts=self._container_client._hosts,# pylint: disable=protected-access
9797
**kwargs) # type: ignore # pylint: disable=protected-access
9898
self._client = AzureDataLakeStorageRESTAPI(self.url, base_url=self.url,
99-
file_system=file_system_name, pipeline=self._pipeline)
99+
file_system=self.file_system_name, pipeline=self._pipeline)
100100
self._datalake_client_for_blob_operation = AzureDataLakeStorageRESTAPI(self._container_client.url,
101101
base_url=self._container_client.url,
102-
file_system=file_system_name,
102+
file_system=self.file_system_name,
103103
pipeline=self._pipeline)
104104
api_version = get_api_version(kwargs)
105105
self._client._config.version = api_version # pylint: disable=protected-access

sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ def __init__(
4242

4343
kwargs.pop('_hosts', None)
4444

45-
self._blob_client = BlobClient(account_url=self._blob_account_url, container_name=file_system_name,
46-
blob_name=path_name,
45+
self._blob_client = BlobClient(account_url=self._blob_account_url, container_name=self.file_system_name,
46+
blob_name=self.path_name,
4747
credential=credential,
4848
_hosts=self._blob_client._hosts, # pylint: disable=protected-access
4949
**kwargs)
5050

51-
self._client = AzureDataLakeStorageRESTAPI(self.url, base_url=self.url, file_system=file_system_name,
52-
path=path_name, pipeline=self._pipeline)
51+
self._client = AzureDataLakeStorageRESTAPI(self.url, base_url=self.url, file_system=self.file_system_name,
52+
path=self.path_name, pipeline=self._pipeline)
5353
self._datalake_client_for_blob_operation = AzureDataLakeStorageRESTAPI(self._blob_client.url,
5454
base_url=self._blob_client.url,
55-
file_system=file_system_name,
56-
path=path_name,
55+
file_system=self.file_system_name,
56+
path=self.path_name,
5757
pipeline=self._pipeline)
5858
api_version = get_api_version(kwargs)
5959
self._client._config.version = api_version # pylint: disable=protected-access
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/xml
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
Content-Length:
12+
- '0'
13+
User-Agent:
14+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
15+
x-ms-date:
16+
- Wed, 06 Apr 2022 22:36:26 GMT
17+
x-ms-version:
18+
- '2020-10-02'
19+
method: PUT
20+
uri: https://storagename.blob.core.windows.net/filesystem916811e6?restype=container&timeout=5
21+
response:
22+
body:
23+
string: ''
24+
headers:
25+
content-length:
26+
- '0'
27+
date:
28+
- Wed, 06 Apr 2022 22:36:25 GMT
29+
etag:
30+
- '"0x8DA181DE2E5EAE8"'
31+
last-modified:
32+
- Wed, 06 Apr 2022 22:36:26 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
49+
Content-Length:
50+
- '0'
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+
- Wed, 06 Apr 2022 22:36:26 GMT
55+
x-ms-version:
56+
- '2020-10-02'
57+
method: PUT
58+
uri: https://storagename.dfs.core.windows.net/filesystem916811e6/file916811e6?resource=file
59+
response:
60+
body:
61+
string: ''
62+
headers:
63+
content-length:
64+
- '0'
65+
date:
66+
- Wed, 06 Apr 2022 22:36:26 GMT
67+
etag:
68+
- '"0x8DA181DE33191DD"'
69+
last-modified:
70+
- Wed, 06 Apr 2022 22:36:27 GMT
71+
server:
72+
- Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
73+
x-ms-request-server-encrypted:
74+
- 'true'
75+
x-ms-version:
76+
- '2020-10-02'
77+
status:
78+
code: 201
79+
message: Created
80+
- request:
81+
body: null
82+
headers:
83+
Accept:
84+
- application/json
85+
Accept-Encoding:
86+
- gzip, deflate
87+
Connection:
88+
- keep-alive
89+
Content-Length:
90+
- '0'
91+
User-Agent:
92+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
93+
x-ms-date:
94+
- Wed, 06 Apr 2022 22:36:27 GMT
95+
x-ms-version:
96+
- '2020-10-02'
97+
method: PUT
98+
uri: https://storagename.dfs.core.windows.net/filesystem916811e6/file916811e6?resource=file
99+
response:
100+
body:
101+
string: ''
102+
headers:
103+
content-length:
104+
- '0'
105+
date:
106+
- Wed, 06 Apr 2022 22:36:26 GMT
107+
etag:
108+
- '"0x8DA181DE33D9E10"'
109+
last-modified:
110+
- Wed, 06 Apr 2022 22:36:27 GMT
111+
server:
112+
- Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
113+
x-ms-request-server-encrypted:
114+
- 'true'
115+
x-ms-version:
116+
- '2020-10-02'
117+
status:
118+
code: 201
119+
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+
- Wed, 06 Apr 2022 22:36:27 GMT
135+
x-ms-version:
136+
- '2020-10-02'
137+
method: DELETE
138+
uri: https://storagename.blob.core.windows.net/filesystem916811e6?restype=container
139+
response:
140+
body:
141+
string: ''
142+
headers:
143+
content-length:
144+
- '0'
145+
date:
146+
- Wed, 06 Apr 2022 22:36:26 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
154+
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/xml
7+
User-Agent:
8+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
9+
x-ms-date:
10+
- Wed, 06 Apr 2022 22:36:34 GMT
11+
x-ms-version:
12+
- '2020-10-02'
13+
method: PUT
14+
uri: https://storagename.blob.core.windows.net/filesystem8a8a16e0?restype=container&timeout=5
15+
response:
16+
body:
17+
string: ''
18+
headers:
19+
content-length: '0'
20+
date: Wed, 06 Apr 2022 22:36:34 GMT
21+
etag: '"0x8DA181DE7C7C166"'
22+
last-modified: Wed, 06 Apr 2022 22:36:34 GMT
23+
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
24+
x-ms-version: '2020-10-02'
25+
status:
26+
code: 201
27+
message: Created
28+
url: https://vincenttrancanary.blob.core.windows.net/filesystem8a8a16e0?restype=container&timeout=5
29+
- request:
30+
body: null
31+
headers:
32+
Accept:
33+
- application/json
34+
User-Agent:
35+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
36+
x-ms-date:
37+
- Wed, 06 Apr 2022 22:36:35 GMT
38+
x-ms-version:
39+
- '2020-10-02'
40+
method: PUT
41+
uri: https://storagename.dfs.core.windows.net/filesystem8a8a16e0/file8a8a16e0?resource=file
42+
response:
43+
body:
44+
string: ''
45+
headers:
46+
content-length: '0'
47+
date: Wed, 06 Apr 2022 22:36:34 GMT
48+
etag: '"0x8DA181DE7F67F66"'
49+
last-modified: Wed, 06 Apr 2022 22:36:35 GMT
50+
server: Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
51+
x-ms-request-server-encrypted: 'true'
52+
x-ms-version: '2020-10-02'
53+
status:
54+
code: 201
55+
message: Created
56+
url: https://vincenttrancanary.dfs.core.windows.net/filesystem8a8a16e0/file8a8a16e0?resource=file
57+
- request:
58+
body: null
59+
headers:
60+
Accept:
61+
- application/json
62+
User-Agent:
63+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
64+
x-ms-date:
65+
- Wed, 06 Apr 2022 22:36:35 GMT
66+
x-ms-version:
67+
- '2020-10-02'
68+
method: PUT
69+
uri: https://storagename.dfs.core.windows.net/filesystem8a8a16e0/file8a8a16e0?resource=file
70+
response:
71+
body:
72+
string: ''
73+
headers:
74+
content-length: '0'
75+
date: Wed, 06 Apr 2022 22:36:34 GMT
76+
etag: '"0x8DA181DE80068FD"'
77+
last-modified: Wed, 06 Apr 2022 22:36:35 GMT
78+
server: Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
79+
x-ms-request-server-encrypted: 'true'
80+
x-ms-version: '2020-10-02'
81+
status:
82+
code: 201
83+
message: Created
84+
url: https://vincenttrancanary.dfs.core.windows.net/filesystem8a8a16e0/file8a8a16e0?resource=file
85+
- request:
86+
body: null
87+
headers:
88+
Accept:
89+
- application/xml
90+
User-Agent:
91+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
92+
x-ms-date:
93+
- Wed, 06 Apr 2022 22:36:35 GMT
94+
x-ms-version:
95+
- '2020-10-02'
96+
method: DELETE
97+
uri: https://storagename.blob.core.windows.net/filesystem8a8a16e0?restype=container
98+
response:
99+
body:
100+
string: ''
101+
headers:
102+
content-length: '0'
103+
date: Wed, 06 Apr 2022 22:36:34 GMT
104+
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
105+
x-ms-version: '2020-10-02'
106+
status:
107+
code: 202
108+
message: Accepted
109+
url: https://vincenttrancanary.blob.core.windows.net/filesystem8a8a16e0?restype=container
110+
version: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/xml
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
Content-Length:
12+
- '0'
13+
User-Agent:
14+
- azsdk-python-storage-dfs/12.7.0b1 Python/3.10.2 (Windows-10-10.0.19044-SP0)
15+
x-ms-date:
16+
- Wed, 06 Apr 2022 21:20:58 GMT
17+
x-ms-version:
18+
- '2020-10-02'
19+
method: PUT
20+
uri: https://storagename.blob.core.windows.net/filesystem92cc1716/?restype=container
21+
response:
22+
body:
23+
string: ''
24+
headers:
25+
content-length:
26+
- '0'
27+
date:
28+
- Wed, 06 Apr 2022 21:20:58 GMT
29+
etag:
30+
- '"0x8DA181357FF4FD1"'
31+
last-modified:
32+
- Wed, 06 Apr 2022 21:20:58 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/xml
45+
Accept-Encoding:
46+
- gzip, deflate
47+
Connection:
48+
- keep-alive
49+
Content-Length:
50+
- '0'
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+
- Wed, 06 Apr 2022 21:20:58 GMT
55+
x-ms-version:
56+
- '2020-10-02'
57+
method: DELETE
58+
uri: https://storagename.blob.core.windows.net/filesystem92cc1716?restype=container
59+
response:
60+
body:
61+
string: ''
62+
headers:
63+
content-length:
64+
- '0'
65+
date:
66+
- Wed, 06 Apr 2022 21:20:58 GMT
67+
server:
68+
- Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
69+
x-ms-version:
70+
- '2020-10-02'
71+
status:
72+
code: 202
73+
message: Accepted
74+
version: 1

0 commit comments

Comments
 (0)