Looks like cell_list_to_rect works wrong
See original GitHub issueI’ve some problem while writeing values to gsheet. So I debug a little gspread.models.update_cells(). Add some print
def update_cells(self, cell_list, value_input_option='RAW'):
print(f'Cell list: {cell_list}')
values_rect = cell_list_to_rect(cell_list)
start = rowcol_to_a1(min(c.row for c in cell_list), min(c.col for c in cell_list))
end = rowcol_to_a1(max(c.row for c in cell_list), max(c.col for c in cell_list))
range_label = '%s!%s:%s' % (self.title, start, end)
print(f'range_label: {range_label}')
print(f'values_rect: {values_rect}')
data = self.spreadsheet.values_update(
range_label,
params={
'valueInputOption': value_input_option
},
body={
'values': values_rect
}
)
return data
This is my output:
Cell list: [<Cell R5C3 9920.0>, <Cell R1C4 'new_column'>, <Cell R5C4 'wow'>]
range_label: Products: Средства для уборки!C1:D5
values_rect: [[9920.0, 'wow']]
It looks like values_rect should be [[None,'new_column'],[None,None],[None,None],[None,None],[9920.0, 'wow']]??? So that means that: values_rect = cell_list_to_rect(cell_list) works bad.
Am I right?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m not sure but it looks like
row_offsetandcol_offsetdefined wrong. Maybe it should be like:@taewookim exactly, thank you for spotting this.
Fixed in #613 / v3.3.0