Fix update_configuration_during_sync example to work with fivetran debug - #618
Merged
fivetran-clgritton merged 3 commits intoAug 19, 2026
Merged
Conversation
…uring local debug The SDK sets FIVETRAN_DEPLOYMENT_MODEL="local_debug" during `fivetran debug` (vs. "managed_cloud"/"hybrid_cloud" in production), and injects placeholder values for FIVETRAN_CONNECTION_ID. Without a guard, update_configuration() always tries to PATCH https://api.fivetran.com/v1/connections/test_connection_id, which fails immediately since there's no real connection or API key locally. This crashes the whole sync via the uncaught response.raise_for_status(), before any data is upserted. This example is documented as "not meant for production use," but it also didn't actually run via `fivetran debug` as shipped, which is confusing for anyone trying to learn from it locally. This adds a check for FIVETRAN_DEPLOYMENT_MODEL == "local_debug" that skips the live REST call and logs the would-be payload instead, so the example runs end-to-end with `fivetran debug` against the fivetran-api-playground mock server. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
payload contains the full config (username, password, fivetran_api_key, token) via secrets_list. Logging it directly with log.info would have written credentials to the sync log. Log only the config key names being updated instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI runs black --check --diff --line-length 99 on PRs; the multi-line f-string in the previous commit exceeded the line length. Wrapped per black's output. Verified: black --check and flake8 both pass clean on this file, and fivetran debug still succeeds end-to-end afterward. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
fivetran-rishabhghosh
requested review from
fivetran-JenasVimal and
fivetran-sahilkhirwal
and removed request for
a team
August 18, 2026 20:27
fivetran-sahilkhirwal
approved these changes
Aug 19, 2026
fivetran-dejantucakov
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira ticket
Closes
<no Jira ticket — small fix found while debugging this example locally; happy to link one if required for merge>Description of Change
The
update_configuration_during_syncexample is documented as "not meant for production use," but it also didn't actually run viafivetran debugas shipped, which is confusing for anyone using it to learn the pattern locally.update_configuration()unconditionally PATCHeshttps://api.fivetran.com/v1/connections/{FIVETRAN_CONNECTION_ID}. Duringfivetran debug,FIVETRAN_CONNECTION_IDis a placeholder (test_connection_id) and there's no real API key to authenticate with, so this call always fails with an uncaughtresponse.raise_for_status(), crashing the whole sync before any data is upserted.The SDK exposes
FIVETRAN_DEPLOYMENT_MODELat runtime, set tolocal_debugduringfivetran debug(vs.managed_cloud/hybrid_cloudin production — see the Environment Variables reference). This adds a check for that value inupdate_configuration(): when running locally, it skips the live REST API call and logs only the config key names it would have updated (never the values, sinceconfigholdsusername/password/fivetran_api_key/token). Production behavior (managed_cloud/hybrid_cloud) is unchanged.Also added a short note to the README's Authentication section explaining this behavior, since it wasn't otherwise documented.
Testing
fivetran debugcommand — ran end-to-end against thefivetran-api-playgroundmock server afterfivetran reset, sync succeeded with 20 upserts into theusertable on each run.['username', 'password', 'fivetran_api_key', 'token']), not values.black --check --diff --line-length 99andflake8both pass clean on the changed file.Checklist
fivetran debugcommand.🤖 Generated with Claude Code