Skip to content

Commit

Permalink
Merge pull request #1119 from burnash/bugfix/numericese_all
Browse files Browse the repository at this point in the history
Bugfix/numericese all
  • Loading branch information
lavigne958 committed Oct 9, 2022
2 parents 409f96d + 8a8d000 commit 3e5745d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gspread/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def numericise_all(
:param list ignore: List of ints of indices of the row (index 1) to ignore
numericising.
"""
# in case someone explicitly passes `None` as ignored list
ignore = ignore or []

numericised_list = [
values[index]
if index + 1 in ignore
Expand Down
2 changes: 1 addition & 1 deletion lint-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bandit==1.7.0
black==22.3.0
codespell==2.1.0
flake8==3.9.2
flake8==5.0.4
isort==5.9.3
3 changes: 3 additions & 0 deletions tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def test_numericise(self):
expected + ["5", 5]
self.assertEqual(utils.numericise_all(inputs, ignore=[5]), expected)

# provide explicit `None` as ignored list
self.assertEqual(utils.numericise_all(inputs, ignore=None), expected)

def test_a1_to_grid_range_simple(self):
expected_single_dimension = {
"startRowIndex": 0,
Expand Down

0 comments on commit 3e5745d

Please sign in to comment.