fix(xlsx): use query_time (not the list itself) for None check (#2891)#2941
Open
ChrisJr404 wants to merge 1 commit into
Open
fix(xlsx): use query_time (not the list itself) for None check (#2891)#2941ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
…ock-project#2891) The CSV branch handles a None query_time correctly: response_time_s = results[site]['status'].query_time if response_time_s is None: response_time_s = '' The xlsx branch initialises response_time_s as an empty list and then checks 'response_time_s is None', which is always False, so the None-fallback never fires and pandas writes the literal None into the xlsx cell instead of an empty string. Check the per-site query_time directly, matching the CSV branch above it. Closes sherlock-project#2891.
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.
Closes #2891.
The CSV branch in
sherlock.pyhandles a missingquery_timecorrectly:The xlsx branch a few lines down initialises
response_time_sas an empty list and then checksif response_time_s is None— which is alwaysFalse(the list isn'tNone), so the empty-string fallback never fires. The literalNoneends up in the xlsx cell when pandas writes the DataFrame.The fix mirrors the CSV branch exactly: check the per-site
query_timedirectly, not the local accumulator. One-line diff.The bug + fix were both already laid out in the issue body by @robert-trach1985-bunny — picking it up to ship it.