Error: The upsert Function Is Missing in the Connector
Issue
While running the fivetran debug command, the following error appears:
RuntimeError: The 'upsert' function is missing in the connector.
Please ensure that the 'upsert' function is properly defined in your code to proceed.
Reference: https://fivetran.com/docs/connectors/connector-sdk/technical-reference#technicaldetailsmethods
This error occurs even when the connector.py file has the upsert function defined correctly.
Environment
Fivetran Connector SDK
Resolution
- Use the - fivetran resetcommand to reset the connector. This command will reset the locally saved cursor and- warehouse.dbfiles, allowing you to re-run- fivetran debugfrom scratch.- fivetran reset
- Restart the debugging process: - fivetran debug
Avoid modifying the connector.py file while the debugging process is running. Always stop the debug process before making changes to your connector code.
Cause
This error arises when the connector.py file is modified during debugging. When changes are made to the connector code while it's being executed, the runtime environment may fail to load the updated version correctly. As a result, the upsert function might appear to be missing, even though it exists in the code.