Skip to content

Commit

Permalink
fiddle method signature around a bit
Browse files Browse the repository at this point in the history
so there is always a `vals` variable
  • Loading branch information
alifeee committed Oct 19, 2023
1 parent ddf3db6 commit 53d5428
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,15 +822,13 @@ def get(
self.spreadsheet_id, range_name, params=params
)

vals_unfilled = response.get("values", [[]])
vals = response.get("values", [[]])

if pad_values is True:
try:
vals = fill_gaps(vals_unfilled)
vals = fill_gaps(vals)
except KeyError:
vals = [[]]
else:
vals = vals_unfilled

if combine_merged_cells is True:
spreadsheet_meta = self.client.fetch_sheet_metadata(self.spreadsheet_id)
Expand All @@ -840,8 +838,8 @@ def get(
)
vals = combined_merge_values(worksheet_meta, vals)

response["values"] = vals
if return_type is GridRangeType.ValueRange:
response["values"] = vals
return ValueRange.from_json(response)
if return_type is GridRangeType.ListOfLists:
return vals
Expand Down

0 comments on commit 53d5428

Please sign in to comment.