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

Fix get_blobs_list_async method to return BlobProperties #32545

Merged
merged 1 commit into from
Jul 12, 2023
Merged
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
10 changes: 10 additions & 0 deletions airflow/providers/microsoft/azure/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
Changelog
---------

6.2.1
.....

.. note::
Note: this version contains a fix to ``get_blobs_list_async`` method in ``WasbHook`` where it returned
a list of blob names, but advertised (via type hints) that it returns a list of ``BlobProperties`` objects.
This was a bug in the implementation and it was fixed in this release. However, if you were relying on the
previous behaviour, you might need to retrieve ``name`` property from the array elements returned by
this method.

6.2.0
.....

Expand Down
4 changes: 2 additions & 2 deletions airflow/providers/microsoft/azure/hooks/wasb.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,10 @@ async def get_blobs_list_async(
:param delimiter: filters objects based on the delimiter (for e.g '.csv')
"""
container = self._get_container_client(container_name)
blob_list = []
blob_list: list[BlobProperties] = []
blobs = container.walk_blobs(name_starts_with=prefix, include=include, delimiter=delimiter, **kwargs)
async for blob in blobs:
blob_list.append(blob.name)
blob_list.append(blob)
return blob_list

async def check_for_prefix_async(self, container_name: str, prefix: str, **kwargs: Any) -> bool:
Expand Down
1 change: 1 addition & 0 deletions airflow/providers/microsoft/azure/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ description: |
`Microsoft Azure <https://azure.microsoft.com/>`__
suspended: false
versions:
- 6.2.1
- 6.2.0
- 6.1.2
- 6.1.1
Expand Down