Skip to content

fix(xlsx): use query_time (not the list itself) for None check (#2891)#2941

Open
ChrisJr404 wants to merge 1 commit into
sherlock-project:masterfrom
ChrisJr404:fix-xlsx-response-time-none
Open

fix(xlsx): use query_time (not the list itself) for None check (#2891)#2941
ChrisJr404 wants to merge 1 commit into
sherlock-project:masterfrom
ChrisJr404:fix-xlsx-response-time-none

Conversation

@ChrisJr404
Copy link
Copy Markdown

Closes #2891.

The CSV branch in sherlock.py handles a missing query_time correctly:

response_time_s = results[site]['status'].query_time
if response_time_s is None:
    response_time_s = ''

The xlsx branch a few lines down initialises response_time_s as an empty list and then checks if response_time_s is None — which is always False (the list isn't None), so the empty-string fallback never fires. The literal None ends up in the xlsx cell when pandas writes the DataFrame.

The fix mirrors the CSV branch exactly: check the per-site query_time directly, 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.

…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.
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.

Bug: xlsx output always appends None for response_time_s when query_time is missing

1 participant