fix(cli): use correct default grid filename in find_sun#36
Open
steps-re wants to merge 1 commit into
Open
Conversation
The `find_sun` command defaulted its `grid` argument to "timezene_grid.json" (misspelled), while `find` and `generate_timezone_grid` use "timezone_grid.json". Because the misspelled file is never found, `quick_find` falls back to regenerating the entire timezone grid on every `find_sun` run, silently defeating the grid caching added in bellingcat#21. Also add tests for the CLI's grid defaults, which were previously untested, to guard against this class of regression. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
The
find_suncommand defaults its--gridargument totimezene_grid.json(misspelled), whilefindandgenerate_timezone_gridboth usetimezone_grid.json.Why it matters
Because
timezene_grid.jsonnever exists,quick_findalways hits itsFileNotFoundErrorfallback and regenerates the entire global timezone grid on everyfind_sunrun. This silently defeats the CLI grid caching added in #21 —findbenefits from the cached grid, butfind_sunnever does.Changes
find_sundefault incli.pyso all three commands share the same grid filename.tests/test_cli.pycovering thegriddefaults acrossfind,find_sun, andgenerate_timezone_grid. The CLI previously had no direct tests; the new test fails on the old default and passes on the fix.Verified locally: full test suite passes (7 passed) and
blackreports no changes.