Skip to content

[python] Fix OSS directory deletion with PyArrow 22+ - #10456

Merged
JingsongLi merged 2 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/pyarrow-s3-delete-compat
Oct 11, 2026
Merged

JingsongLi merged 2 commits into
apache:masterfrom
XiaoHongbo-Hope:codex/pyarrow-s3-delete-compat

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

PyArrow 22+ directory deletion fails on OSS because its batch request does not carry the Content-MD5 required by that endpoint. For PyArrow-backed OSS and custom S3 endpoints, use Boto3 to list and delete directory keys in batches of at most 1,000. Validate partial failures and remaining keys; delete XML-incompatible keys individually. Other backends and older PyArrow versions keep their existing path.

This prepares #9821; the package still requires pyarrow<20. Boto3 is a test dependency here and must become a runtime dependency when PyArrow 22+ is enabled. The generic FileIO does not apply table schema ordering or create parent markers. Directory deletion remains non-atomic.

Validation: local tests passed with PyArrow 22 (95), 19 and 16.1 (89 each, 6 skipped); PyArrow 23 targeted tests passed (22). The HTTP test covers Content-MD5 under simulated FIPS restrictions. Flake8 and Python 3.6 syntax checks passed. An earlier revision was tested against real OSS; this revision has not been rerun there.

@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Fix directory deletion on OSS and custom S3 with newer PyArrow [python] Prepare OSS and custom S3 directory deletion for PyArrow 22+ Oct 9, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Prepare OSS and custom S3 directory deletion for PyArrow 22+ [python] Fix OSS directory deletion with PyArrow 22+ Oct 9, 2026
@XiaoHongbo-Hope
XiaoHongbo-Hope force-pushed the codex/pyarrow-s3-delete-compat branch from 03b16d1 to 911e8d3 Compare October 11, 2026 09:43
@XiaoHongbo-Hope
XiaoHongbo-Hope force-pushed the codex/pyarrow-s3-delete-compat branch from 911e8d3 to 537f791 Compare October 11, 2026 09:46
@XiaoHongbo-Hope
XiaoHongbo-Hope marked this pull request as ready for review October 11, 2026 13:42

@JingsongLi JingsongLi 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.

+1

@JingsongLi
JingsongLi merged commit bfc84c8 into apache:master Oct 11, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants