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

[BUDI-8579] Create more realistic tests for Google Sheets #14535

Merged
merged 15 commits into from
Sep 10, 2024
Merged
11 changes: 9 additions & 2 deletions packages/server/src/integrations/googlesheets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ export class GoogleSheetsIntegration implements DatasourcePlus {
case Operation.BULK_CREATE:
return this.createBulk({ sheet, rows: json.body as Row[] })
case Operation.BULK_UPSERT:
// This is technically not correct because it won't update existing
// rows, but it's better than not having this functionality at all.
return this.createBulk({ sheet, rows: json.body as Row[] })
case Operation.READ:
return this.read({ ...json, sheet })
Expand All @@ -397,14 +399,19 @@ export class GoogleSheetsIntegration implements DatasourcePlus {
sheet,
})
case Operation.CREATE_TABLE:
if (json.table === undefined) {
if (json.table == null) {
samwho marked this conversation as resolved.
Show resolved Hide resolved
throw new Error(
"attempted to create a table without specifying the table to create"
)
}
return this.createTable(json.table)
case Operation.UPDATE_TABLE:
return this.updateTable(json.table!)
if (json.table == null) {
throw new Error(
"attempted to create a table without specifying the table to create"
)
}
return this.updateTable(json.table)
case Operation.DELETE_TABLE:
return this.deleteTable(json?.table?.name)
default:
Expand Down
Loading
Loading