fix: correct None check in xlsx response_time_s block (#2891)#2922
Open
victoireantoine1707-design wants to merge 1 commit intosherlock-project:masterfrom
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Nonechecks whether the list itself is None — which is always False since
it is initialized as an empty list
[]. As a result, when a site'squery_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 NoneThis 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.