From 99326c493b040b76db7aae9e3a08286c262761bb Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 18 Mar 2026 15:47:54 +0000 Subject: [PATCH 1/5] activate anon bucket test --- tests/test_real_s3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_real_s3.py b/tests/test_real_s3.py index 1af391d9..36215ed2 100644 --- a/tests/test_real_s3.py +++ b/tests/test_real_s3.py @@ -31,9 +31,9 @@ def test_anon_s3(): }, active_storage_url=active_storage_url) active._version = 2 - with pytest.raises(ReductionistError): - result = active.min()[:] - assert result == 197.69595 + + result = active.min()[:] + assert result == 197.69595 def test_s3_small_file(): From b0fb765fd0af27b6404c782ceed33c75d9fc02ff Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 18 Mar 2026 15:48:14 +0000 Subject: [PATCH 2/5] anon auth in reductionist --- activestorage/reductionist.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/activestorage/reductionist.py b/activestorage/reductionist.py index 17b26d21..aa56531d 100644 --- a/activestorage/reductionist.py +++ b/activestorage/reductionist.py @@ -24,11 +24,6 @@ def get_session(username: str, password: str, :returns: a client session object. """ session = requests.Session() - # TODO Stack-HPC - # we need to allow Anon buckets. though this - # will break connection to data server - # if username is None and password is None: - # return session session.auth = (username, password) session.verify = cacert or False return session From 367db92be62292d130ef03603f4a3d5b054fe86e Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 18 Mar 2026 16:17:13 +0000 Subject: [PATCH 3/5] correct handling of secrets and keys --- activestorage/active.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/activestorage/active.py b/activestorage/active.py index 438c52c0..513dc1e6 100644 --- a/activestorage/active.py +++ b/activestorage/active.py @@ -515,20 +515,19 @@ def _from_storage(self, ds, indexer, chunks, out_shape, out_dtype, if self.interface_type == "s3" and self._version == 2: if self.storage_options is not None: key, secret = None, None - if self.storage_options.get("anon", None) is True: - print("Reductionist session for Anon S3 bucket.") - session = reductionist.get_session( - None, None, S3_ACTIVE_STORAGE_CACERT) if "key" in self.storage_options: key = self.storage_options["key"] if "secret" in self.storage_options: secret = self.storage_options["secret"] - if key and secret: - session = reductionist.get_session( - key, secret, S3_ACTIVE_STORAGE_CACERT) + elif self.storage_options.get("anon", None) is True: + print("Reductionist session for Anon S3 bucket.") + key = None + secret = None else: - session = reductionist.get_session( - S3_ACCESS_KEY, S3_SECRET_KEY, S3_ACTIVE_STORAGE_CACERT) + key = S3_ACCESS_KEY + secret = S3_SECRET_KEY + session = reductionist.get_session( + key, secret, S3_ACTIVE_STORAGE_CACERT) else: session = reductionist.get_session(S3_ACCESS_KEY, S3_SECRET_KEY, From a21ed6e23ca37e93c162f484f79b860e53ca24cc Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 18 Mar 2026 16:17:34 +0000 Subject: [PATCH 4/5] add a print statement --- activestorage/reductionist.py | 1 + 1 file changed, 1 insertion(+) diff --git a/activestorage/reductionist.py b/activestorage/reductionist.py index aa56531d..002c454b 100644 --- a/activestorage/reductionist.py +++ b/activestorage/reductionist.py @@ -86,6 +86,7 @@ def reduce_chunk(session, print(f"Reductionist request data dictionary: {request_data}") api_operation = "sum" if operation == "mean" else operation or "select" url = f'{server}/v2/{api_operation}/' + print("Reductionist Session auth:", session.auth) response = request(session, url, request_data) if response.ok: From 263804cc7f0557787c89e710fe98ef342b494bdc Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 18 Mar 2026 16:21:58 +0000 Subject: [PATCH 5/5] flake8 --- activestorage/active.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activestorage/active.py b/activestorage/active.py index 513dc1e6..efa29b47 100644 --- a/activestorage/active.py +++ b/activestorage/active.py @@ -527,7 +527,7 @@ def _from_storage(self, ds, indexer, chunks, out_shape, out_dtype, key = S3_ACCESS_KEY secret = S3_SECRET_KEY session = reductionist.get_session( - key, secret, S3_ACTIVE_STORAGE_CACERT) + key, secret, S3_ACTIVE_STORAGE_CACERT) else: session = reductionist.get_session(S3_ACCESS_KEY, S3_SECRET_KEY,