Skip to content

Create MAAP client lazily in stage_in - #11

Merged
sujen1412 merged 3 commits into
developfrom
fix/lazy-maap-client
Oct 15, 2026
Merged

sujen1412 merged 3 commits into
developfrom
fix/lazy-maap-client

Conversation

@sujen1412

Copy link
Copy Markdown
Collaborator

Fixes #10

stage_in.py built MAAP() at import, so every job (via create_inputs.py's import stage_in) called /api/environment/config even with no file inputs.

  • Replace module-level maap = MAAP() with a cached _get_maap(), called only in _download_asset for non-s3://maap- URLs.
  • Update tests/test_stage_in.py to patch stage_in._get_maap; add tests that no client is created for MAAP S3 downloads and that it's created once on demand.

Tests: 39 pass in tests/test_stage_in.py; test_stac_extensions_preserved and test_self_href_set_to_local_path fail identically on the base branch (pre-existing, unrelated).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XHifpuJ7Q83CrNkchsbuRj


Generated by Claude Code

claude and others added 3 commits October 7, 2026 17:49
Avoids the /api/environment/config call at import time for jobs with no
file inputs (fixes #10).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XHifpuJ7Q83CrNkchsbuRj
@sujen1412
sujen1412 merged commit 049ee8d into develop Oct 15, 2026
2 checks passed
@sujen1412
sujen1412 deleted the fix/lazy-maap-client branch October 15, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants