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

[Storage] [STG 98] API Views Feedback and Changelogs #40123

Draft
wants to merge 2 commits into
base: feature/storage-stg98
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _parse_url(account_url: str) -> "ParseResult":
def _format_url(scheme: str, hostname: str, file_system_name: Union[str, bytes], path_name: str, query_str: str) -> str:
if isinstance(file_system_name, str):
file_system_name = file_system_name.encode('UTF-8')
return f"{scheme}://{hostname}/{quote(file_system_name)}/{quote(path_name, safe='~')}{query_str}"
return f"{scheme}://{hostname}/{quote(file_system_name)}/{quote(path_name, safe='~/')}{query_str}"


def _create_path_options(
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-file-share/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "python",
"TagPrefix": "python/storage/azure-storage-file-share",
"Tag": "python/storage/azure-storage-file-share_adb38dd356"
"Tag": "python/storage/azure-storage-file-share_1350cebb03"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ def create_hardlink(
process_storage_error(error)

@distributed_trace
def create_symbolic_link(
def create_symlink(
self, target: str,
*,
metadata: Optional[Dict[str, str]] = None,
Expand All @@ -1751,7 +1751,7 @@ def create_symbolic_link(
timeout: Optional[int] = None,
**kwargs: Any
) -> Dict[str, Any]:
"""NFS only. Create a symbolic link to the specified file.
"""NFS only. Creates a symbolic link to the specified file.

:param str target:
Specifies the file path the symbolic link will point to. The file path can be either relative or absolute.
Expand Down Expand Up @@ -1793,7 +1793,7 @@ def create_symbolic_link(
process_storage_error(error)

@distributed_trace
def get_symbolic_link(
def get_symlink(
self,
*,
timeout: Optional[int] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ async def create_hardlink(
process_storage_error(error)

@distributed_trace_async
async def create_symbolic_link(
async def create_symlink(
self, target: str,
*,
metadata: Optional[Dict[str, str]] = None,
Expand All @@ -1752,7 +1752,7 @@ async def create_symbolic_link(
timeout: Optional[int] = None,
**kwargs: Any
) -> Dict[str, Any]:
"""NFS only. Create a symbolic link to the specified file.
"""NFS only. Creates a symbolic link to the specified file.

:param str target:
Specifies the file path the symbolic link will point to. The file path can be either relative or absolute.
Expand Down Expand Up @@ -1794,7 +1794,7 @@ async def create_symbolic_link(
process_storage_error(error)

@distributed_trace_async
async def get_symbolic_link(
async def get_symlink(
self,
*,
timeout: Optional[int] = None,
Expand Down
12 changes: 6 additions & 6 deletions sdk/storage/azure-storage-file-share/tests/test_nfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_create_hardlink_error(self, **kwargs: Any):

@FileSharePreparer()
@recorded_by_proxy
def test_create_and_get_symbolic_link(self, **kwargs):
def test_create_and_get_symlink(self, **kwargs):
premium_storage_file_account_name = kwargs.pop("premium_storage_file_account_name")

self._setup(premium_storage_file_account_name)
Expand All @@ -293,7 +293,7 @@ def test_create_and_get_symbolic_link(self, **kwargs):
owner, group = "345", "123"
target = f"{directory_name}/{source_file_name}"

resp = symbolic_link_file_client.create_symbolic_link(
resp = symbolic_link_file_client.create_symlink(
target=target,
metadata=metadata,
owner=owner,
Expand All @@ -310,15 +310,15 @@ def test_create_and_get_symbolic_link(self, **kwargs):
assert 'file_attributes' not in resp
assert 'file_permission_key' not in resp

resp = symbolic_link_file_client.get_symbolic_link()
resp = symbolic_link_file_client.get_symlink()
assert resp is not None
assert resp['etag'] is not None
assert resp['last_modified'] is not None
assert unquote(resp['link_text']) == target

@FileSharePreparer()
@recorded_by_proxy
def test_create_and_get_symbolic_link_error(self, **kwargs):
def test_create_and_get_symlink_error(self, **kwargs):
premium_storage_file_account_name = kwargs.pop("premium_storage_file_account_name")

self._setup(premium_storage_file_account_name)
Expand All @@ -333,9 +333,9 @@ def test_create_and_get_symbolic_link_error(self, **kwargs):
target = f"{directory_name}/{source_file_name}"

with pytest.raises(ResourceNotFoundError) as e:
symbolic_link_file_client.create_symbolic_link(target=target)
symbolic_link_file_client.create_symlink(target=target)
assert 'ParentNotFound' in e.value.args[0]

with pytest.raises(ResourceNotFoundError) as e:
symbolic_link_file_client.get_symbolic_link()
symbolic_link_file_client.get_symlink()
assert 'ParentNotFound' in e.value.args[0]
12 changes: 6 additions & 6 deletions sdk/storage/azure-storage-file-share/tests/test_nfs_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ async def test_create_hardlink_error(self, **kwargs: Any):

@FileSharePreparer()
@recorded_by_proxy_async
async def test_create_and_get_symbolic_link(self, **kwargs):
async def test_create_and_get_symlink(self, **kwargs):
premium_storage_file_account_name = kwargs.pop("premium_storage_file_account_name")

await self._setup(premium_storage_file_account_name)
Expand All @@ -305,7 +305,7 @@ async def test_create_and_get_symbolic_link(self, **kwargs):
owner, group = "345", "123"
target = f"{directory_name}/{source_file_name}"

resp = await symbolic_link_file_client.create_symbolic_link(
resp = await symbolic_link_file_client.create_symlink(
target=target,
metadata=metadata,
owner=owner,
Expand All @@ -322,15 +322,15 @@ async def test_create_and_get_symbolic_link(self, **kwargs):
assert 'file_attributes' not in resp
assert 'file_permission_key' not in resp

resp = await symbolic_link_file_client.get_symbolic_link()
resp = await symbolic_link_file_client.get_symlink()
assert resp is not None
assert resp['etag'] is not None
assert resp['last_modified'] is not None
assert unquote(resp['link_text']) == target

@FileSharePreparer()
@recorded_by_proxy_async
async def test_create_and_get_symbolic_link_error(self, **kwargs):
async def test_create_and_get_symlink_error(self, **kwargs):
premium_storage_file_account_name = kwargs.pop("premium_storage_file_account_name")

await self._setup(premium_storage_file_account_name)
Expand All @@ -345,9 +345,9 @@ async def test_create_and_get_symbolic_link_error(self, **kwargs):
target = f"{directory_name}/{source_file_name}"

with pytest.raises(ResourceNotFoundError) as e:
await symbolic_link_file_client.create_symbolic_link(target=target)
await symbolic_link_file_client.create_symlink(target=target)
assert 'ParentNotFound' in e.value.args[0]

with pytest.raises(ResourceNotFoundError) as e:
await symbolic_link_file_client.get_symbolic_link()
await symbolic_link_file_client.get_symlink()
assert 'ParentNotFound' in e.value.args[0]