Skip to content

Move test datasets to the netzoo-data S3 bucket - #396

Merged
katehoffshutta merged 1 commit into
netZoo:develfrom
marouenbg:fix/s3-test-data-bucket
Sep 21, 2026
Merged

katehoffshutta merged 1 commit into
netZoo:develfrom
marouenbg:fix/s3-test-data-bucket

Conversation

@marouenbg

Copy link
Copy Markdown
Contributor

Fixes the CI failures in tests/test_dragon.py::test_dragon and tests/test_panda.py::test_panda that currently hit every branch (e.g. #394, #395).

Problem

Both tests download their data at test time from netzoo.s3.us-east-2.amazonaws.com, which now returns 403 AccessDenied to anonymous requests. Because they fetched with os.system('curl -O …'), which ignores HTTP errors, the XML error body was silently written over the data file. That surfaced as ValueError: Cannot load file containing pickled data when allow_pickle=False in test_dragon and a 2-row "ground truth" (DataFrame shape mismatch) in test_panda — misleading symptoms for what is a download failure. The old bucket cannot be read back from AWS either (authenticated access is denied by its policy).

New bucket

The 14 files the tests need — netZooPy/unittest_datasets/dragonx{1,2}.npy and netZooPy/tutorial_datasets/gt_panda{1..12}.txt (≈115 MB) — were restored from verified local copies (correct shapes, MD5-checked) into a new bucket, netzoo-data (us-east-2), using the same key layout as before:

https://netzoo-data.s3.us-east-2.amazonaws.com/netZooPy/…

The bucket policy grants anonymous s3:GetObject only (no listing). All 14 objects were verified anonymously fetchable and byte-identical to the originals. Only these test files were migrated — nothing else from the old bucket was available to copy.

Code changes

tests/test_dragon.py, tests/test_panda.py: the base URL is a single module constant S3_BASE_URL, and downloads go through a small _download() helper (urllib.request.urlretrieve) that raises on any HTTP error, so a future outage fails at the download with the URL in the message instead of corrupting the comparison. The now-unused import os is dropped.

Verification

  • pytest tests/test_dragon.py tests/test_panda.py → 8 passed locally, downloading from the new bucket.
  • CI's blocking flake8 rule (E9,F63,F7,F82) is clean; no unused imports.

Notes

🤖 Generated with Claude Code

The netzoo bucket that test_dragon and test_panda downloaded their data
from now returns 403 AccessDenied. Because the tests fetched it with
os.system('curl -O ...'), which ignores HTTP errors, the XML error body
silently replaced the data file, surfacing as an allow_pickle error in
test_dragon and a 2-row ground truth in test_panda on every branch.

The 14 files (dragonx1/2.npy and gt_panda1-12.txt) now live in the
netzoo-data bucket under the same key layout. Both tests fetch them
through a small _download helper that raises on any HTTP error, so a
future outage fails loudly at the download instead of corrupting the
comparison. Drop the now-unused os imports.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@katehoffshutta katehoffshutta added ai-contrib Some or all of this code is written by AI and requires a human review. human-reviewed For code generated by AI, this label confirms someone human has reviewed it. labels Sep 21, 2026
@katehoffshutta
katehoffshutta merged commit 84143ec into netZoo:devel Sep 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-contrib Some or all of this code is written by AI and requires a human review. human-reviewed For code generated by AI, this label confirms someone human has reviewed it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants