Skip to content

Conversation

@EdwardKaravakis
Copy link
Member

Avoid flagging empty JSON responses from CRIC as retrieval errors. Empty dumps ({} → []) are now considered valid and result in empty blacklist lists, while only actual retrieval or parsing failures trigger warnings and fallback behavior.

@tmaeno tmaeno requested a review from fbarreir October 10, 2025 09:06
except Exception as e:
# Only on actual failure do we fall back to empty and continue
self.log_stream.warning(
"Failed to retrieve ddmblacklist(read); defaulting to empty. Error: %s", e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f-string please.
Otherwise by eye it looks OK, but should be tested for ATLAS CRIC once to see it doesn't break anything

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course, changed it to f-string - thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that the non-f-string is there, makes me think you didn't install the pre-commit tools (flynt), which should have fixed it automatically

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I don't have it installed for my forked repo on my laptop.. will fix this asap

…ensures that write, read, and full (DDM detailed) blacklist retrievals behave consistently and only fail on actual fetch/parse errors (None or exceptions), as per Valerio’s feedback.
@EdwardKaravakis EdwardKaravakis merged commit 7825836 into PanDAWMS:master Oct 13, 2025
1 check passed
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.

3 participants