You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/25 07:42:57 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #13206: ARROW-15906: [C++][Python][R] By default, don't create or delete S3 buckets

jorisvandenbossche commented on code in PR #13206:
URL: https://github.com/apache/arrow/pull/13206#discussion_r881325065


##########
python/pyarrow/tests/test_dataset.py:
##########
@@ -4505,9 +4507,21 @@ def test_write_dataset_s3_put_only(s3_server):
     ).to_table()
     assert result.equals(table)
 
-    with pytest.raises(OSError, match="Access Denied"):
+    # Passing create_dir is fine if the bucket already exists
+    ds.write_dataset(
+        table, "existing-bucket", filesystem=fs,
+        format="feather", create_dir=True, partitioning=part,
+        existing_data_behavior='overwrite_or_ignore'
+    )
+    # check roundtrip
+    result = ds.dataset(
+        "existing-bucket", filesystem=fs, format="ipc", partitioning="hive"
+    ).to_table()
+    assert result.equals(table)
+
+    with pytest.raises(OSError, match="Bucket does not exist"):
         ds.write_dataset(
-            table, "existing-bucket", filesystem=fs,
+            table, "non-existing-bucket", filesystem=fs,

Review Comment:
   To retain the original purpose of the test, should we use an `fs` with allow_create_bucket set to True? So that it raises the original error? (even if the user sets this parameter to True, we still need to honor the limitations / the create_dir keyword)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org