Skip to content

fix: show category cache rebuild notice - #106

Merged
aborruso merged 1 commit into
mainfrom
fix/categories-build-notice
Nov 14, 2026
Merged

aborruso merged 1 commit into
mainfrom
fix/categories-build-notice

Conversation

@aborruso

@aborruso aborruso commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Problem

When the category cache has expired (7-day TTL), siblings and tree re-download categoryscheme + categorisation. On Eurostat this took 1:56 for siblings NAMA_10_GDP, with nothing printed in a pipe or in -o json/-o csv mode: it looked like a hang.

The notice already existed in load_categories(), but as logger.info. The CLI does not configure logging, so Python's WARNING default hides it (effective level 30, no handlers).

Change

  • src/opensdmx/categories.py: notice now logger.warning (stderr, every output mode, stdout stays clean), skipped under --explain. Text no longer says "first run", since it also fires on expiry.
  • tests/test_categories.py: two tests (notice shown at WARNING; not shown under --explain). Both fail without the fix.

Provider-agnostic: affects every provider with a category tree, INPS hub included.

Checks

  • ruff, mypy, pytest: 523 passed
  • Live: OPENSDMX_CATEGORIES_CACHE_TTL=0 opensdmx -o json siblings EXR --provider ecb -> notice on stderr, valid JSON on stdout
  • --explain on Eurostat: plan only, no notice

🤖 Generated with Claude Code

logger.info was never displayed (no logging config, WARNING default), so a
1-2 min categoryscheme download looked like a hang. Use logger.warning
(stderr, all output modes), skip under --explain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RCCNPJu2AbWwKkX6LjCj9A
@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

Makes category-cache rebuilds visible without changing how categories are fetched or cached.

  • Category cache rebuilds now show a notice while they run.

No actionable issues found. Tests were reviewed but not run.

Reviews (1) · Last reviewed commit: "fix: show category cache rebuild notice" · Reviewed by Greptile

@aborruso
aborruso merged commit 3a18bbe into main Nov 14, 2026
2 checks passed
@aborruso
aborruso deleted the fix/categories-build-notice branch November 14, 2026 17:06
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.

1 participant