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

specify batch_size for google sheets #2101

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,8 @@ export interface Payload {
* Set as true to ensure Segment sends data to Google Sheets in batches. Please do not set to false.
*/
enable_batching?: boolean
/**
* Maximum number of events to include in each batch. Actual batch sizes may be lower.
*/
batch_size?: number
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ const action: ActionDefinition<Settings, Payload> = {
fields: {
label: 'Fields',
description: `
The fields to write to the spreadsheet.
The fields to write to the spreadsheet.

On the left-hand side, input the name of the field as it will appear in the Google Sheet.

On the left-hand side, input the name of the field as it will appear in the Google Sheet.

On the right-hand side, select the field from your data model that maps to the given field in your sheet.

---

`,
type: 'object',
required: true,
Expand All @@ -75,6 +75,16 @@ const action: ActionDefinition<Settings, Payload> = {
label: 'Batch Data to Google Sheets',
description: 'Set as true to ensure Segment sends data to Google Sheets in batches. Please do not set to false.',
default: true
},
batch_size: {
label: 'Batch Size',
description: 'Maximum number of events to include in each batch. Actual batch sizes may be lower.',
type: 'number',
required: false,
unsafe_hidden: true,
// There was no documented max value for this, however 5k would be large enough for most
// bulk use cases and improve throughput for some data flows. This can be adjusted as needed.
default: 5_000
}
},
perform: (request, { payload }) => {
Expand Down
Loading