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

✨ [source-google-sheets] add row_batch_size as an input parameter #35320

Closed
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 @@ -10,7 +10,7 @@ data:
connectorSubtype: file
connectorType: source
definitionId: 71607ba1-c0ac-4799-8049-7f4b90dd50f7
dockerImageTag: 0.3.16
dockerImageTag: 0.3.17
dockerRepository: airbyte/source-google-sheets
documentationUrl: https://docs.airbyte.com/integrations/sources/google-sheets
githubIssueLabel: source-google-sheets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.3.16"
version = "0.3.17"
name = "source-google-sheets"
description = "Source implementation for Google Sheets."
authors = [ "Airbyte <[email protected]>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def _read(
state: Union[List[AirbyteStateMessage], MutableMapping[str, Any]] = None,
) -> Generator[AirbyteMessage, None, None]:
client = GoogleSheetsClient(self.get_credentials(config))
client.Backoff.row_batch_size = config["batch_size"]

sheet_to_column_name = Helpers.parse_sheet_and_column_names_from_catalog(catalog)
spreadsheet_id = Helpers.get_spreadsheet_id(config["spreadsheet_id"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ connectionSpecification:
- credentials
additionalProperties: true
properties:
batch_size:
type: integer
title: Batch Size
description: >-
An integer representing batch size for each Google Sheets API request.
Default value is 200, as it was with previous connector's version.
default: 200
spreadsheet_id:
type: string
title: Spreadsheet Link
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def test_client_get_values_on_backoff(caplog):
majorDimension="ROWS",
)

assert "Fetching range sheet!0:220" in caplog.text
assert "Fetching range sheet!0:220" in caplog.text
5 changes: 3 additions & 2 deletions docs/integrations/sources/google-sheets.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ If your spreadsheet is viewable by anyone with its link, no further action is ne
- To authenticate your Google account via OAuth, select **Authenticate via Google (OAuth)** from the dropdown and enter your Google application's client ID, client secret, and refresh token.
<!-- /env:oss -->
6. For **Spreadsheet Link**, enter the link to the Google spreadsheet. To get the link, go to the Google spreadsheet you want to sync, click **Share** in the top right corner, and click **Copy Link**.
7. (Optional) You may enable the option to **Convert Column Names to SQL-Compliant Format**. Enabling this option will allow the connector to convert column names to a standardized, SQL-friendly format. For example, a column name of `Café Earnings 2022` will be converted to `cafe_earnings_2022`. We recommend enabling this option if your target destination is SQL-based (ie Postgres, MySQL). Set to false by default.
8. Click **Set up source** and wait for the tests to complete.
7. For **Batch Size**, enter an integer which represents batch size when processing a Google Sheet. Default value is 200.
8. (Optional) You may enable the option to **Convert Column Names to SQL-Compliant Format**. Enabling this option will allow the connector to convert column names to a standardized, SQL-friendly format. For example, a column name of `Café Earnings 2022` will be converted to `cafe_earnings_2022`. We recommend enabling this option if your target destination is SQL-based (ie Postgres, MySQL). Set to false by default.
9. Click **Set up source** and wait for the tests to complete.

<HideInUI>

Expand Down
Loading