Skip to content

Commit

Permalink
sheets update python type -> sheets api type mapping for _obj_value
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbugs committed Jun 21, 2022
1 parent d7a7407 commit c02889e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pyontutils/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pickle
import itertools
from pathlib import Path
from numbers import Number
from urllib.parse import urlparse
import idlib
import htmlfn as hfn
Expand Down Expand Up @@ -418,14 +419,21 @@ def _obj_range(self):
def _obj_update(self):
return {'updateCells': {
'rows': [
{'values': [
{'userEnteredValue': {'stringValue': self._value_str,}},]},],
{'values': [self._obj_value(),]},],
'fields': 'userEnteredValue',
#'start': self._obj_coord(), # only need one of start or range
'range': self._obj_range(),}}

def _obj_value(self):
return {'userEnteredValue': {'stringValue': self._value_str,}}
value = self._value_str
if isinstance(value, bool):
d = {'boolValue': value}
elif isinstance(value, Number):
d = {'numberValue': value}
else:
d = {'stringValue': value}

return {'userEnteredValue': d}


class Row:
Expand Down

0 comments on commit c02889e

Please sign in to comment.