aboutsummaryrefslogtreecommitdiffstats
path: root/hommaexceli_py/sheets_client.py
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@valuemotive.com>2021-02-14 17:51:34 +0200
committerJan Tuomi <jan.tuomi@valuemotive.com>2021-02-14 17:51:34 +0200
commit34dc42bca46397118cf4f53e2f119eea1d56cdc1 (patch)
tree210dfa562ce16a5bba7ed1ac8b624792ab973acd /hommaexceli_py/sheets_client.py
parentbd2f7811b1f1633e150642222a9e07b5dd7a375a (diff)
Fix last done column updatingmaster
Diffstat (limited to 'hommaexceli_py/sheets_client.py')
-rw-r--r--hommaexceli_py/sheets_client.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/hommaexceli_py/sheets_client.py b/hommaexceli_py/sheets_client.py
index 242dca8..36dabb2 100644
--- a/hommaexceli_py/sheets_client.py
+++ b/hommaexceli_py/sheets_client.py
@@ -89,16 +89,13 @@ def fetch_sheet_data(service: Resource) -> list[SheetsRow]:
return [_row_to_dataclass(row) for row in rows]
-def update_sheet_last_done_column(
- service: Resource, processed_rows: list[ProcessedRow]
-):
+def update_sheet_last_done_column(service: Resource, new_datestamps: list[str]):
logging.info("Calling Sheets API to update last done column...")
range = getenv("SHEETS_RANGE")
sheet = service.spreadsheets()
last_done_column_range = _get_rightmost_column_in_range(range)
- # Update last done date to match next date
- body = {"values": list(map(lambda row: [row.next_datestamp], processed_rows))}
+ body = {"values": [[datestamp] for datestamp in new_datestamps]}
sheet.values().update(
spreadsheetId=getenv("SHEETS_SPREADSHEET_ID"),