diff --git a/activestorage/active.py b/activestorage/active.py index dfab6f81..438c52c0 100644 --- a/activestorage/active.py +++ b/activestorage/active.py @@ -250,7 +250,7 @@ def __init__(self, elif input_variable and self.interface_type == "s3": self.filename = self.ds.id._filename elif input_variable and self.interface_type == "https": - self.filename = self.ds + self.filename = self.ds.id._filename # get storage_options self.storage_options = storage_options @@ -726,7 +726,7 @@ def _process_chunk(self, elif self.interface_type == "https" and self._version == 2: tmp, count = reductionist.reduce_chunk(session, self.active_storage_url, - f"{self.uri}", + self.filename, offset, size, compressor, diff --git a/tests/test_real_https.py b/tests/test_real_https.py index b8baa814..e3cef862 100644 --- a/tests/test_real_https.py +++ b/tests/test_real_https.py @@ -92,6 +92,20 @@ def test_https(): assert result.shape == (1, 1, 144, 192) assert result[0, 0, 0, 0] == f_1 assert result[0, 0, 143, 191] == f_2 + + # run with pyfive.Dataset instead of File + dataset = load_from_https(test_file_uri) + av = dataset['ta'] + active = Active(av, + active_storage_url=active_storage_url) + active._version = 2 + print("Interface type", active.interface_type) + result = active.min(axis=(0, 1))[:] + print("Result is", result) + print("Result shape is", result.shape) + assert result.shape == (1, 1, 144, 192) + assert result[0, 0, 0, 0] == f_1 + assert result[0, 0, 143, 191] == f_2 @pytest.mark.skip( diff --git a/tests/test_real_s3.py b/tests/test_real_s3.py index decc2ffd..1af391d9 100644 --- a/tests/test_real_s3.py +++ b/tests/test_real_s3.py @@ -61,7 +61,6 @@ def test_s3_small_file(): assert result == 222.09129333496094 -@pytest.mark.xfail(reason="Pyfive needs PR #197") def test_s3_small_dataset(): """Run an S3 test on a small file.""" storage_options = {