-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-15906: [C++][Python][R] By default, don't create or delete S3 buckets #13206
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
94e6166
Add option to not create buckets
wjones127 1e65e1d
Test deletion control
wjones127 300c915
Add support for option in Python interface
wjones127 9a8486c
Add R changes
wjones127 cd979a1
Make it easier to change the create bucket behavior
wjones127 3e319e2
Document methods
wjones127 0a65bb8
Format
wjones127 c52568f
Adjust test expectations
wjones127 25adf4a
feat: allow_create_buckets supported in S3Options::FromURI()
wjones127 b961c26
doc: Guide users to create buckets some other way
wjones127 b1bb3bc
Add back original test
wjones127 749300b
chore: change to two separate settings
wjones127 31abe7c
feat: Make boolean parsing stricter
wjones127 02a1db0
feat: Just allow configuration before construction
wjones127 76addc5
fix: remove mention of deletion on creation option
wjones127 367efd3
fix: Make sure new options can be pickled
wjones127 4164e11
chore: push error msg test down to C++
wjones127 deb99f3
fix: correct error match statement
wjones127 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,7 +212,9 @@ def s3fs(request, s3_server): | |
| access_key=access_key, | ||
| secret_key=secret_key, | ||
| endpoint_override='{}:{}'.format(host, port), | ||
| scheme='http' | ||
| scheme='http', | ||
| allow_bucket_creation=True, | ||
| allow_bucket_deletion=True | ||
| ) | ||
| fs.create_dir(bucket) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add tests in |
||
|
|
||
|
|
@@ -443,6 +445,12 @@ def test_s3fs_limited_permissions_create_bucket(s3_server): | |
| ) | ||
| fs.create_dir('existing-bucket/test') | ||
|
|
||
| with pytest.raises(pa.ArrowIOError, match="Bucket 'new-bucket' not found"): | ||
| fs.create_dir('new-bucket') | ||
|
|
||
| with pytest.raises(pa.ArrowIOError, match="Would delete bucket"): | ||
| fs.delete_dir('existing-bucket') | ||
|
|
||
|
|
||
| def test_file_info_constructor(): | ||
| dt = datetime.fromtimestamp(1568799826, timezone.utc) | ||
|
|
@@ -1036,6 +1044,10 @@ def test_s3_options(): | |
| assert isinstance(fs, S3FileSystem) | ||
| assert pickle.loads(pickle.dumps(fs)) == fs | ||
|
|
||
| fs = S3FileSystem(allow_bucket_creation=True, allow_bucket_deletion=True) | ||
| assert isinstance(fs, S3FileSystem) | ||
| assert pickle.loads(pickle.dumps(fs)) == fs | ||
|
|
||
| with pytest.raises(ValueError): | ||
| S3FileSystem(access_key='access') | ||
| with pytest.raises(ValueError): | ||
|
|
@@ -1308,8 +1320,9 @@ def test_filesystem_from_uri_s3(s3_server): | |
|
|
||
| host, port, access_key, secret_key = s3_server['connection'] | ||
|
|
||
| uri = "s3://{}:{}@mybucket/foo/bar?scheme=http&endpoint_override={}:{}" \ | ||
| .format(access_key, secret_key, host, port) | ||
| uri = "s3://{}:{}@mybucket/foo/bar?scheme=http&endpoint_override={}:{}"\ | ||
| "&allow_bucket_creation=True" \ | ||
| .format(access_key, secret_key, host, port) | ||
|
|
||
| fs, path = FileSystem.from_uri(uri) | ||
| assert isinstance(fs, S3FileSystem) | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.