azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

[Storage] [Typing] [Blob] Misc files (`_serialize.py`, `_deserialize.py`, `_download.py`)

Open vincenttran-msft opened this issue 1 year ago • 3 comments

(Updated 1/10) Remaining errors on:

_deserialize.py: azure\storage\blob_deserialize.py:159: error: Incompatible types in assignment (expression has type "Optional[BlobType]", variable has type "BlobType") [assignment] azure\storage\blob_deserialize.py:169: error: Incompatible types in assignment (expression has type "Optional[datetime]", variable has type "datetime") [assignment] azure\storage\blob_deserialize.py:171: error: Incompatible types in assignment (expression has type "Optional[int]", variable has type "int") [assignment] azure\storage\blob_deserialize.py:173: error: Incompatible types in assignment (expression has type "Optional[bool]", variable has type "bool") [assignment] azure\storage\blob_deserialize.py:177: error: Incompatible types in assignment (expression has type "Union[str, AccessTier, None]", variable has type "Optional[StandardBlobTier]") [assignment]

  • Going to let these slide as they will be resolved in a following PR.

_download.py: azure\storage\blob_download.py:675: error: Argument 1 to "readinto" of "StorageStreamDownloader" has incompatible type "BytesIO"; expected "IO[str]" [arg-type] azure\storage\blob_download.py:678: error: Incompatible return value type (got "str", expected "bytes") [return-value] azure\storage\blob_download.py:679: error: Incompatible return value type (got "bytes", expected "str") [return-value] azure\storage\blob_download.py:753: error: No overload variant of "write" of "IO" matches argument type "bytes" [call-overload] azure\storage\blob_download.py:753: note: Possible overload variants: azure\storage\blob_download.py:753: note: def write(self, str, /) -> int

  • These remaining ones are all around read readall and readinto. Seems like it doesn't play nicely with the generic T type-hinting mumbo-jumbo we are trying to do 😄
  • Cast, type the deprecated ones

vincenttran-msft avatar Dec 18 '23 22:12 vincenttran-msft

API change check

API changes are not detected in this pull request.

azure-sdk avatar Dec 19 '23 01:12 azure-sdk

/azp run python - storage - ci

vincenttran-msft avatar Jan 08 '24 19:01 vincenttran-msft

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jan 08 '24 19:01 azure-pipelines[bot]