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/11/23 14:37:52 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #14716: ARROW-18392: [Python] Fix test_s3fs_wrong_region; match when UNKNOWN

pitrou commented on code in PR #14716:
URL: https://github.com/apache/arrow/pull/14716#discussion_r1030523191


##########
python/pyarrow/tests/test_fs.py:
##########
@@ -1321,22 +1321,24 @@ def test_s3fs_wrong_region():
     from pyarrow.fs import S3FileSystem
 
     # wrong region for bucket
-    fs = S3FileSystem(region='eu-north-1')
+    # anonymous=True incase CI/etc has invalid credentials
+    fs = S3FileSystem(region='eu-north-1', anonymous=True)
 
     msg = ("When getting information for bucket 'voltrondata-labs-datasets': "
            r"AWS Error UNKNOWN \(HTTP status 301\) during HeadBucket "
            "operation: No response body. Looks like the configured region is "
-           "'eu-north-1' while the bucket is located in 'us-east-2'."
-           "|NETWORK_CONNECTION")
-    with pytest.raises(OSError, match=msg) as exc:
+           "'eu-north-1' while the bucket is located in 'us-east-2'.")
+    with pytest.raises(OSError) as exc:
         fs.get_file_info("voltrondata-labs-datasets")
 
-    # Sometimes fails on unrelated network error, so next call would also fail.
-    if 'NETWORK_CONNECTION' in str(exc.value):
+    # Sometimes fails on unrelated network or permission error, so next
+    # call would also fail.
+    if 'UNKNOWN' not in str(exc.value):

Review Comment:
   Why "not in"? Don't we want this condition to be a bit more specific?



-- 
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