Skip to content

fix: correct None check in xlsx response_time_s block (#2891)#2922

Open
victoireantoine1707-design wants to merge 1 commit intosherlock-project:masterfrom
victoireantoine1707-design:fix/xlsx-response-time-none
Open

fix: correct None check in xlsx response_time_s block (#2891)#2922
victoireantoine1707-design wants to merge 1 commit intosherlock-project:masterfrom
victoireantoine1707-design:fix/xlsx-response-time-none

Conversation

@victoireantoine1707-design
Copy link
Copy Markdown

The condition checked if response_time_s (a list) is None, which is always False. Fixed to check the actual query_time value instead, consistent with the CSV block above it.
issue 2891

Problem
In the xlsx output block, the condition if response_time_s is None
checks whether the list itself is None — which is always False since
it is initialized as an empty list []. As a result, when a site's
query_time is None (timeout/error), None gets appended to the list
instead of an empty string, causing Excel cells to contain None.$

Solution proposed
Changed the condition to check the actual value:
if results[site]["status"].query_time is None

This is consistent with the CSV block just above it (lines ~882-884).
Verification
Manually reviewed the code logic. The fix mirrors the already-correct
CSV implementation in the same function.

…ct#2891)

The condition checked if response_time_s (a list) is None, which is
always False. Fixed to check the actual query_time value instead,
consistent with the CSV block above it.
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