-
Notifications
You must be signed in to change notification settings - Fork 30
add gusto connector example #442
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||
| """ | ||||||
| Gusto connector for Fivetran Connector SDK. | ||||||
| Fetches HR and payroll data from Gusto API. | ||||||
| """ | ||||||
|
|
||||||
| import requests | ||||||
|
||||||
| from fivetran_connector_sdk import connector, config, state, records, log, schema | ||||||
|
Comment on lines
+6
to
+7
|
||||||
| from fivetran_connector_sdk import connector, config, state, records, log, schema | |
| from fivetran_connector_sdk import connector, config, state, records, schema |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing required structure. The connector is missing: (1) import json for configuration file reading, (2) schema(configuration: dict) function with required docstring, (3) update(configuration: dict, state: dict) function with required docstring, (4) Connector initialization: connector = Connector(update=update, schema=schema), (5) Main block for local debugging with if __name__ == '__main__': connector.debug(). See template_example_connector/connector.py lines 7-166 for the complete required structure.
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BLOCKER: The entire structure is incompatible with Fivetran Connector SDK. The SDK does not use decorators, Config classes, or Schema classes. Instead, it requires: (1) A schema(configuration: dict) function that returns a list of table dictionaries, (2) An update(configuration: dict, state: dict) function for data fetching, (3) A Connector object initialized with these functions: connector = Connector(update=update, schema=schema). Configuration should be provided via configuration.json file. See template_example_connector/connector.py for the correct implementation pattern.
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing retry logic for API request. Network calls must implement retry logic with exponential backoff for transient failures (network errors, rate limits, 5xx errors). Limit to 3-5 retry attempts and log each retry. Example: for attempt in range(__MAX_RETRIES): try: response = requests.get(...); break except (requests.Timeout, requests.ConnectionError) as e: if attempt == __MAX_RETRIES - 1: raise; sleep_time = min(60, 2 ** attempt); time.sleep(sleep_time)
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential memory issue: response.json() loads the entire response into memory. For large employee datasets, this could cause memory overflow. If the Gusto API supports pagination, implement it to process data in chunks. If pagination is not available and datasets are guaranteed to be small, add a comment explaining why full materialization is acceptable.
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BLOCKER: Incorrect operations usage. The SDK does not have a records.write() function. Instead, use op.upsert(table='gusto_employees', data=emp) after importing from fivetran_connector_sdk import Operations as op. Each upsert call must be preceded by a comment explaining its purpose.
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BLOCKER: Incorrect state management. The SDK does not use ctx.update_state(). Instead, state should be updated via op.checkpoint(state) where state is a dictionary. The update function should not return anything. State checkpointing must occur after successful data operations with the required comment: # Save the progress by checkpointing the state...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module docstring should include a link to technical reference documentation. Expected format: Line 1 should be a one-line description, followed by reference links. Example from template:
\"\"\"ADD ONE LINE DESCRIPTION OF YOUR CONNECTOR HERE.\\nSee the Technical Reference documentation (https://fivetran.com/docs/connectors/connector-sdk/technical-reference#update)\\nand the Best Practices documentation (https://fivetran.com/docs/connectors/connector-sdk/best-practices) for details\"\"\"