-
Notifications
You must be signed in to change notification settings - Fork 30
add swift connector example #438
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,38 @@ | ||||||
| """ | ||||||
| Swift connector for Fivetran Connector SDK. | ||||||
| Fetches payment data via SWIFT API (mock endpoint for base setup). | ||||||
| """ | ||||||
|
|
||||||
| import requests | ||||||
|
||||||
| import requests | |
| import requests # For making HTTP API requests (provided by SDK runtime) |
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 SDK imports. The Fivetran Connector SDK uses a different import pattern. Use these exact imports instead: from fivetran_connector_sdk import Connector, from fivetran_connector_sdk import Logging as log, and from fivetran_connector_sdk import Operations as op. The decorator-based pattern with @connector, config, state, records, and schema imports does not exist in the SDK.
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.
Import of 'log' is not used.
| 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.
BLOCKER: This configuration pattern is not supported by the Fivetran Connector SDK. Configuration should be defined in a configuration.json file which the SDK automatically validates. Remove this CONFIG object and create a configuration.json file instead with the required fields.
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: This schema definition pattern is not supported. The SDK requires a schema() function that returns a list of table dictionaries. Replace this with a proper schema(configuration: dict) function following the template format.
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 decorator-based @connector pattern is not part of the Fivetran Connector SDK. The SDK requires an update(configuration: dict, state: dict) function and a Connector object initialized as connector = Connector(update=update, schema=schema). Remove the decorator and implement the required functions.
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: No retry logic implemented for the API request. Network calls must include retry logic with exponential backoff to handle transient failures (timeouts, connection errors, 5xx responses). Implement a retry mechanism with a maximum of 3-5 attempts.
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 specific exception handling. Generic exceptions from raise_for_status() should be caught and handled specifically (e.g., distinguish between 4xx client errors that shouldn't be retried vs 5xx server errors that should). Implement proper error handling with specific exception types.
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: Potential memory issue - the code loads all transactions into memory at once with response.json().get('data', []). For large datasets, this can cause memory overflow. Implement pagination or streaming to process data in chunks.
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 operation method. The SDK uses op.upsert(table=table_name, data=record) not records.write(). Additionally, this operation requires a comment explaining the upsert operation as per SDK requirements.
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 pattern. The SDK uses op.checkpoint(state) to save state, and the update function should not return state. Replace with proper checkpointing using op.checkpoint() and include the required checkpoint comment.
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.
Using string literal 'now' as a timestamp value is incorrect. Use a proper ISO 8601 timestamp format like datetime.datetime.now().isoformat() or a Unix timestamp.
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 the mandatory main block for debugging. Add the following at the end:
if __name__ == '__main__':block withconnector.debug(configuration=configuration)as shown in the template.