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

[azure-storage-blob] list_blobs() cannot work with include=metadata #12926

Closed
Juliehzl opened this issue Aug 6, 2020 · 6 comments
Closed

[azure-storage-blob] list_blobs() cannot work with include=metadata #12926

Juliehzl opened this issue Aug 6, 2020 · 6 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@Juliehzl
Copy link

Juliehzl commented Aug 6, 2020

  • Package Name: azure-storage-blob
  • Package Version: 12.4.0-b1
  • Operating System: Windows
  • Python Version: 3.7.7

Describe the bug
A clear and concise description of what the bug is.

When listing blobs in a container with metadata information, as description mentioned and track1 behavior, we could add --include=metadata to get such results.

But when I use it in new sdk, I can get the response with metadata information in raw response here as shown below but after deserialization it is skipped and change to None.

b'\xef\xbb\xbf<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="https://zuhdefault.blob.core.windows.net/" ContainerName="test1">
<MaxResults>2</MaxResults><Blobs>
<Blob><Name>a.txt</Name><VersionId>2020-08-06T03:20:00.9910412Z</VersionId>
<IsCurrentVersion>true</IsCurrentVersion><Properties><Creation-Time>Tue, 14 Jul 2020 07:58:04 GMT</Creation-Time>
<Last-Modified>Thu, 06 Aug 2020 03:20:00 GMT</Last-Modified><Etag>0x8D839B79AAF1A66</Etag>
<Content-Length>1200</Content-Length><Content-Type>text/plain; charset=utf-8</Content-Type><Content-Encoding />
<Content-Language /><Content-CRC64 /><Content-MD5>4edJNByMxQgCm9dVVN4KWQ==</Content-MD5>
<Cache-Control /><Content-Disposition /><BlobType>BlockBlob</BlobType><AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted></Properties><Metadata><test>1</test></Metadata><OrMetadata /></Blob>
<Blob><Name>ast.md</Name><Properties><Creation-Time>Tue, 14 Jul 2020 07:58:05 GMT</Creation-Time>
<Last-Modified>Tue, 14 Jul 2020 07:58:05 GMT</Last-Modified><Etag>0x8D827CBA3A2B2BC</Etag>
<Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding />
<Content-Language /><Content-CRC64 /><Content-MD5>1B2M2Y8AsgTpgAmY7PhCfg==</Content-MD5>
<Cache-Control /><Content-Disposition /><BlobType>BlockBlob</BlobType><AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted></Properties><Metadata /><OrMetadata /></Blob></Blobs>
<NextMarker>2!72!MDAwMDA5IWZpbGUxLnR4dCEwMDAwMjghOTk5OS0xMi0zMVQyMzo1OTo1OS45OTk5OTk5WiE-</NextMarker>
</EnumerationResults>'

I am guessing it is because Model ListBlobsFlatSegmentResponse doesn't include metadata properties. But I think if we have such behavior to include metadata, we should return response with metadata and it will be fine to align with track1 behavior.

If there is anything misuse, feel free to let me know.

To Reproduce
Steps to reproduce the behavior:

  1. list_blobs() with include=metadata

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 6, 2020
@kaerm kaerm added Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Aug 6, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 6, 2020
@ghost
Copy link

ghost commented Aug 6, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@Juliehzl
Copy link
Author

Hi @kaerm, it seems @xgithubtriage is not valid name.

@kaerm
Copy link
Contributor

kaerm commented Aug 12, 2020

It should be working - there is some weirdness around github and how it displays team handles

@xiafu-msft
Copy link
Contributor

Hi @Juliehzl

I'm not able to reproduce it, the test in this pr is working #13260

@tasherif-msft
Copy link
Contributor

Hi @Juliehzl, it should be working. As you have mentioned our list blobs operation is using ListBlobsFlatSegmentResponse however it does deserialize metadata. It has an attribute segment that gets desarialized. This attribute has a dependency on BlobFlatListSegment class which contains an attribute BlobItermInternal class which contains the metadata attribute.

Please let us know if you need further help. Otherwise we can proceed to close this issue.

@tasherif-msft tasherif-msft self-assigned this Oct 7, 2020
@tasherif-msft tasherif-msft added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Oct 7, 2020
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Oct 14, 2020
@ghost
Copy link

ghost commented Oct 14, 2020

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@ghost ghost closed this as completed Oct 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants