pitrou commented on code in PR #13206:
URL: https://github.com/apache/arrow/pull/13206#discussion_r890095199
##########
python/pyarrow/_s3fs.pyx:
##########
@@ -253,6 +266,9 @@ cdef class S3FileSystem(FileSystem):
"'proxy_options': expected 'dict' or 'str', "
f"got {type(proxy_options)} instead.")
+ options.allow_bucket_creation = allow_bucket_creation
+ options.allow_bucket_deletion = allow_bucket_deletion
+
Review Comment:
You'll also need to update `__reduce__` below.
##########
python/pyarrow/tests/test_fs.py:
##########
@@ -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)
Review Comment:
Can you also add tests in `test_s3_options`?
##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -353,6 +354,12 @@ Result<S3Options> S3Options::FromUri(const Uri& uri,
std::string* out_path) {
options.scheme = kv.second;
} else if (kv.first == "endpoint_override") {
options.endpoint_override = kv.second;
+ } else if (kv.first == "allow_bucket_creation") {
+ ARROW_ASSIGN_OR_RAISE(options.allow_bucket_creation,
+ ::arrow::internal::ParseBoolean(kv.second));
+ } else if (kv.first == "allow_bucket_deletion") {
+ ARROW_ASSIGN_OR_RAISE(options.allow_bucket_deletion,
+ ::arrow::internal::ParseBoolean(kv.second));
Review Comment:
Can you also update `S3Options::Equals`?
##########
python/pyarrow/tests/test_fs.py:
##########
@@ -443,6 +445,12 @@ def test_s3fs_limited_permissions_create_bucket(s3_server):
)
fs.create_dir('existing-bucket/test')
+ with pytest.raises(pa.ArrowIOError):
Review Comment:
Perhaps also add a `match=` argument to also check relevant part of the
error message?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]