Skip to content

feat(services): support conditional delete for Azure services - #8142

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/azure-delete-with-if-match
Aug 26, 2026
Merged

feat(services): support conditional delete for Azure services#8142
Xuanwo merged 3 commits into
mainfrom
xuanwo/azure-delete-with-if-match

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Aug 25, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #8141.

Rationale for this change

delete_with_if_match enables compare-and-delete workflows such as lease release and orphan cleanup. Azure Blob Storage and Azure Data Lake Storage Gen2 support conditional delete requests, but their OpenDAL services do not currently advertise or forward this condition.

What changes are included in this PR?

  • Send If-Match in Azure Blob single deletes and in each batch subrequest. Preserve each OpDelete in batch results so conditions remain associated with their paths.
  • Send If-Match in ADLS Path Delete requests, including recursive-delete continuation requests.
  • Strengthen conditional-delete behavior coverage with stale-replacement and mixed batch-result cases.

Are there any user-facing changes?

Yes. azblob and azdls now advertise delete_with_if_match, so callers can use op.delete_with(path).if_match(etag). A stale ETag returns ConditionNotMatch without deleting the replacement object.

Azure Files remains unchanged because its Delete File REST API does not expose an If-Match condition.

AI Usage Statement

AI materially assisted with implementation and validation. The contributor directed and reviewed the API scope and service behavior. The implementation was checked against the official Azure REST API contracts; live Azure behavior tests were not run locally because service credentials were unavailable.

@Xuanwo
Xuanwo marked this pull request as ready for review August 25, 2026 09:56
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Aug 25, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 25, 2026
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 26, 2026
@Xuanwo
Xuanwo merged commit 3558ed1 into main Aug 26, 2026
145 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/azure-delete-with-if-match branch August 26, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: support conditional delete for Azure services

2 participants