[Storage Files] Migrating to TypeSpec#46929
Draft
l0lawrence wants to merge 49 commits into
Draft
Conversation
Move pylint disable comments to the correct lines where violations occur (protected-access, unused-argument) and fix implicit string concatenation in _parser.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…h hacks Refactor the 10 custom subclasses in azure/storage/fileshare/_models.py (RetentionPolicy, Metrics, CorsRule, SmbMultichannel, SmbEncryptionInTransit, ShareSmbSettings, NfsEncryptionInTransit, ShareNfsSettings, ShareProtocolSettings, AccessPolicy) so they no longer shadow the parent _RestField descriptors and properly delegate to super().__init__(**kwargs). With the subclasses fixed at the source, the runtime monkey-patches in _generated/models/_patch.py (_patched_getattr/setattr/getattribute/new) are no longer needed; revert that file to the empty stock template. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Port changes from azure-storage-blob storageblob3 branch to keep _shared files consistent across Storage packages: - request_handlers.py: collapse split string literals - uploads.py / uploads_async.py: switch BlockBlob/PageBlob/AppendBlob ChunkUploader callers to keyword args and to the new etag / match_condition / append_position kwarg names; pop those kwargs in upload_data_chunks and upload_substream_blocks when running in parallel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The wire format for creationTime/lastAccessTime/lastWriteTime/changeTime is ISO 8601, not RFC 7231 (only Last-Modified is RFC 7231). Declaring them as Optional[datetime.datetime] with format="rfc7231" causes the XML deserializer to fail and leave a raw xml.etree.ElementTree.Element in _data, which crashes JSON serialization downstream (Azure CLI). Match the legacy SDK behavior by declaring these fields as Optional[str]. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolved conflicts in azure-storage-file-share tests/perfstress by keeping the PR's reformatted versions (Azure#46609 was pure pylint reformatting, already covered by the branch's own reformat). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move 'protected-access' disables from closing-bracket lines onto the lines where '_from_generated' is actually accessed (Metrics, SharePropertiesPaged, HandlesPaged). - Use scoped 'disable/enable=protected-access' block in DirectoryPropertiesPaged._extract_data_cb (two accesses too long to carry inline disables under the 120-char limit). - Add 'unused-argument' disables to the backcompat **kwargs catch-all __init__ methods on SmbMultichannel, SmbEncryptionInTransit, ShareSmbSettings, NfsEncryptionInTransit, ShareNfsSettings, and ShareProtocolSettings. No logic changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
l0lawrence
commented
May 15, 2026
| if parallel and "modified_access_conditions" in kwargs: | ||
| # Access conditions do not work with parallelism | ||
| kwargs["modified_access_conditions"] = None | ||
| if parallel: |
Member
Author
There was a problem hiding this comment.
these changes are from storage-blob changes with typespec
l0lawrence
commented
May 15, 2026
| @@ -53,18 +54,20 @@ class ShareLeaseClient: # pylint: disable=client-accepts-api-version-keyword | |||
| This will be `None` if no lease has yet been acquired or modified.""" | |||
|
|
|||
| def __init__( # pylint: disable=missing-client-constructor-parameter-credential, missing-client-constructor-parameter-kwargs | |||
| self, client: Union["ShareFileClient", "ShareClient"], | |||
| lease_id: Optional[str] = None | |||
l0lawrence
commented
May 15, 2026
| if isinstance(self._client, FileOperations) and lease_break_period: | ||
| raise TypeError("Setting a lease break period is only applicable to Share leases.") | ||
|
|
||
| if self._allow_trailing_dot is not None: |
Member
Author
There was a problem hiding this comment.
why does this have a if not none check
l0lawrence
commented
May 15, 2026
| ) -> Tuple["LocationMode", Any]: | ||
| file_properties = deserialize_file_properties(response, obj, headers) | ||
| # The new TypeSpec-generated download returns an iterator (from iter_bytes/iter_raw) | ||
| # instead of a response object with settable attributes. Wrap it. |
Member
Author
|
/azp run python - storage - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.