Fix float parsing of ISO section codes like 5.10#799
Open
VivekGhantiwala wants to merge 1 commit intoOWASP:mainfrom
Open
Fix float parsing of ISO section codes like 5.10#799VivekGhantiwala wants to merge 1 commit intoOWASP:mainfrom
VivekGhantiwala wants to merge 1 commit intoOWASP:mainfrom
Conversation
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
Replace
get_all_records()withget_all_values()inread_spreadsheet()to prevent gspread'snumericise()fromconverting ISO section codes like "5.10" to float 5.1.
Why
get_all_records()internally callsnumericise()which strips trailing zeros from decimal-looking strings. Theexisting
numericise_ignoreworkaround misses column 0 and depends on gspread internals that have known bugs (see gspread#1007).get_all_values()always returns raw cell strings, so "5.10" stays "5.10". We manually construct the row dicts usingthe header row.
Testing
Existing test
test_read_spreadsheet_iso_numbersvalidates that section IDs "1.10" and "10.10" are preserved asstrings.
Closes #574
Closes #546