Skip to content

[Python] test_s3_real_aws_region_selection is failing due to expected IOError not being raised #47165

@raulcd

Description

@raulcd

Describe the bug, including details regarding any error messages, version, and platform.

Python tests are currently failing on several PRs with the following error:

______________________ test_s3_real_aws_region_selection _______________________

    @pytest.mark.s3
    def test_s3_real_aws_region_selection():
        # Taken from a registry of open S3-hosted datasets
        # at https://github.com/awslabs/open-data-registry
        fs, path = FileSystem.from_uri('s3://mf-nwp-models/README.txt')
        assert fs.region == 'eu-west-1'
        with fs.open_input_stream(path) as f:
            assert b"Meteo-France Atmospheric models on AWS" in f.read(50)
    
        # Passing an explicit region disables auto-selection
        fs, path = FileSystem.from_uri(
            's3://mf-nwp-models/README.txt?region=us-east-2')
        assert fs.region == 'us-east-2'
        # Reading from the wrong region may still work for public buckets...
    
        # Nonexistent bucket (hopefully, otherwise need to fix this test)
        with pytest.raises(IOError, match="Bucket '.*' not found"):
>           FileSystem.from_uri('s3://x-arrow-nonexistent-bucket')
E           Failed: DID NOT RAISE <class 'OSError'>

A couple of PRs with the failing tests can be seen here:

I've been able to reproduce locally with archery docker run ubuntu-python

This started some minutes ago (it was going on the same PR a couple hours ago) without any code change being merged.

Component(s)

Python

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions