Skip to content

Commit

Permalink
sheets fix to avoid updating cells for empty string/None swapping
Browse files Browse the repository at this point in the history
also a note that there is actually some quadraticness issue present

could probably work around the issue by issuing api commands for whole
rows instead of cell by cell
  • Loading branch information
tgbugs committed Jun 22, 2022
1 parent c02889e commit 0d58fa9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pyontutils/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,13 @@ def _setCellValue(self, cell, value):
return

if cell not in self._uncommitted_updates:
self._uncommitted_updates[cell] = cell.value # store the old values
_cv = cell.value
if value == '' and _cv == None or value == None and _cv == '':
# don't push changes related to empty string vs None very bad
# for perf due to some lurking quadraticness
pass
else:
self._uncommitted_updates[cell] = cell.value # store the old values
except IndexError:
# there was no old value so not comparing and not storing
# the cell will have to figure out how to remove values
Expand Down Expand Up @@ -1269,6 +1275,8 @@ def _commit_thunks_requests(self):
yield from thunk()

def _commit_requests(self):
# FIXME there is some lurking quadraticness in here e.g. when
# trying to update ALL cells in a big sheet ~100k sheets
yield from self._commit_appends_requests()
yield from self._commit_updates_requests()
yield from self._commit_deletes_requests()
Expand Down

0 comments on commit 0d58fa9

Please sign in to comment.