Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another follow-up lambda hotfix #3686

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws/src/main/python/spreadsheetData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Since this lambda function has external dependencies it has to be deployed in a
To do that

1. `cd aws/src/main/python/spreadsheetData`
1. `pip3 install --target ./package requests`
1. `pip3 install -r requirements.txt --target ./package`
1. ```
cd package
zip -r ../my-deployment-package.zip .
Expand Down
9 changes: 6 additions & 3 deletions aws/src/main/python/spreadsheetData/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ def new_row(sheet_id, is_completed):

last_index = row_count + 1

dimension_request = None
# Adjusting number of rows to match the max_rows target (either adding or deleting)
if last_index <= max_rows:
if row_count < max_rows:
dimension_request = {
"insertDimension": {
"inheritFromBefore": True,
Expand All @@ -411,7 +412,7 @@ def new_row(sheet_id, is_completed):
},
}
}
else:
elif row_count > max_rows:
dimension_request = {
"deleteDimension": {
"range": {
Expand Down Expand Up @@ -446,7 +447,9 @@ def new_row(sheet_id, is_completed):
}
}
}]
requests.append(dimension_request)

if dimension_request != None:
requests.append(dimension_request)

body = {
"includeSpreadsheetInResponse": False,
Expand Down