Skip to content

[Storage] Fix Arrow list_blobs dropping copy destination_snapshot - #48564

Open
vincenttran-msft wants to merge 2 commits into
Azure:mainfrom
vincenttran-msft:vincenttran/fix_photon_python
Open

[Storage] Fix Arrow list_blobs dropping copy destination_snapshot#48564
vincenttran-msft wants to merge 2 commits into
Azure:mainfrom
vincenttran-msft:vincenttran/fix_photon_python

Conversation

@vincenttran-msft

@vincenttran-msft vincenttran-msft commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

When listing blobs with response_format="arrow" and include=["copy"], the destination_snapshot field on a blob's copy properties was always None, even for incremental-copy blobs where the service populates it. The XML listing path and every other SDK path returned the value correctly. This is because the XML name was incorrectly mapped to the wrong key.

Problem Root Cause Solution
Arrow list_blobs/walk_blobs always returned copy.destination_snapshot = None In _list_blobs_helper.py, _COPY_FIELDS mapped the Arrow column as "DestinationSnapshot", but the real wire column is "CopyDestinationSnapshot" (Copy-prefixed, like every other copy column). The lookup never matched, so the value was silently dropped. Changed the mapping key "DestinationSnapshot""CopyDestinationSnapshot" (header value x-ms-copy-destination-snapshot unchanged).

Testing

Added a live regression test, test_arrow_list_blobs_populates_copy_destination_snapshot, that performs a real incremental copy (page blob → snapshot → user-delegation-SAS source → incremental copy) and asserts the Arrow-parsed destination_snapshot matches the value from the get-properties path. The column name is taken from a real service response rather than assumed.

Test-Driven Development Proof

Same test, run live before updating the mapping (i.e. mapping that is in main currently, DestinationSnapshot)

E   AssertionError: assert None == '2026-08-13T01:02:54.4473507Z'
E    +  where None = {... 'incremental_copy': True, 'destination_snapshot': None}.destination_snapshot
azure-storage-blob\tests\test_arrow.py:600: AssertionError
1 failed

In short, this failed because it expected a value, but was unexpectedly None because although the value came back across the wire, it was mapped to the wrong key (DestinationSnapshot) and thus silently swallowed.

The get-properties path returned destination_snapshot = '2026-08-13T01:02:54.4473507Z', while the Arrow path returned None.

With the fix applied, the same test now passes.

TODO:

  • Maybe shift these to a different version (maybe another beta release?)

Copilot AI balanced review requested due to automatic review settings August 13, 2026 01:15
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Aug 13, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@vincenttran-msft vincenttran-msft changed the title [Storage] Fix Arrow list_blobs dropping copy destination_snapshot** [Storage] Fix Arrow list_blobs dropping copy destination_snapshot Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Arrow blob listings so incremental-copy destination snapshots are preserved.

Changes:

  • Corrected the Arrow copy-field mapping.
  • Added a live regression test.
  • Documented the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
_list_blobs_helper.py Corrects the Arrow column mapping.
test_arrow.py Tests incremental-copy snapshot parsing.
CHANGELOG.md Records the bug fix.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk/storage/azure-storage-blob/tests/test_arrow.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 13, 2026 01:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

A CI pipeline failed on this pull request. Here is an automated analysis of what went wrong and how to get the build green.

What failed

The python - pullrequest pipeline (build #6695608) failed on the black formatting check for azure-storage-blob. Specifically, tests/test_arrow.py has a line that exceeds Black's line-length limit and needs to be reformatted. Black would split:

snapshot_blob = BlobClient.from_blob_url(source_blob.url, credential=token_credential, snapshot=source_snapshot)

into a multi-line call. This is the only file/check that failed.

Recommended next steps

  • From the sdk/storage/azure-storage-blob directory, run:
    azpysdk black .
    
    This will auto-reformat all files (including tests/test_arrow.py) in place.
  • Commit and push the reformatted file.
  • See the CI troubleshooting guide: https://aka.ms/ci-fix
  • Push new commits to address the failures; this comment updates automatically on the next failing run.
Raw pipeline analysis (azsdk ci analyze)
Build: 6695608 Project: public
PipelineUrl: https://dev.azure.com/azure-sdk/public/_build/results?buildId=6695608

Failed Tasks: black check for azure-storage-blob

[azure-storage-blob :: black] The package azure-storage-blob has black formatting issues.
Run `azpysdk black .` locally from the package root to reformat.

Black diff:
--- tests/test_arrow.py
+++ tests/test_arrow.py
@@ -558,11 +558,13 @@
-            snapshot_blob = BlobClient.from_blob_url(source_blob.url, credential=token_credential, snapshot=source_snapshot)
+            snapshot_blob = BlobClient.from_blob_url(
+                source_blob.url, credential=token_credential, snapshot=source_snapshot
+            )

Black summary:
would reformat /mnt/vss/_work/1/s/sdk/storage/azure-storage-blob/tests/test_arrow.py
1 file would be reformatted, 205 files would be left unchanged.
black check completed with exit code 1

Failing checks:
  python - pullrequest [FAILURE]
  Url: https://dev.azure.com/azure-sdk/29ec6040-b234-4e31-b139-33dc4287b756/_build/results?buildId=6695608
  python - pullrequest (Build Analyze) [FAILURE]
  Url: https://dev.azure.com/azure-sdk/29ec6040-b234-4e31-b139-33dc4287b756/_build/results?buildId=6695608&view=logs&jobId=b70e5e73-bbb6-5567-0939-8415943fadb9

Copilot detected the failing pipeline and generated the analysis above. To have it attempt a fix automatically, reply with @copilot please fix the failing pipeline on this PR.

Generated by Pipeline Analysis - Next Steps · 23.4 AIC · ⌖ 8.72 AIC · ⊞ 6.6K ·


@pytest.mark.live_test_only
@BlobPreparer()
def test_arrow_list_blobs_populates_copy_destination_snapshot(self, **kwargs):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need the async test as well probably. But also, maybe we don't need this test, or this could be combined into another one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants