fix(databricks): surface an actionable error for a missing SQL warehouse - #73095
Merged
Gilbert09 merged 1 commit intoJul 23, 2026
Merged
Conversation
The validate-credentials error map was missing the RESOURCE_DOES_NOT_EXIST case that the sync-time non-retryable map already handles, so a mistyped or deleted SQL warehouse in the HTTP path fell through to the generic "Could not connect to Databricks" message. Map it to an actionable message pointing at the HTTP path. Generated-By: PostHog Code Task-Id: bcf35e5a-9e8d-4794-8256-810b0e99cb65
There was a problem hiding this comment.
Trivial, contained error-message mapping addition with matching test coverage, by an author on the owning team; no showstoppers.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 3L, 1F substantive, 4L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1a-trivial (4L, 2F, single-area, fix) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ 24c0565 · reviewed head d2de662 |
|
😎 This pull request was merged. |
Contributor
|
Hey @Gilbert09! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
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.
Problem
The Databricks source-creation wizard shows a generic "Could not connect to Databricks. Please check all connection details are valid." for a very common setup mistake: an HTTP path pointing at a SQL warehouse that was mistyped or deleted. That message gives the user nothing to act on, and it was the single biggest bucket of Databricks setup failures.
The root cause is drift between two error maps. The sync-time
get_non_retryable_errorsmap already recognizesRESOURCE_DOES_NOT_EXISTand tells the user their warehouse is gone, but the validate-timeDatabricksErrorsmap (used during source creation) never got the same entry. So a bad warehouse in the HTTP path was recognized during sync but fell through to the generic catch-all at create time.Changes
RESOURCE_DOES_NOT_EXISTto the validate-time error map with a message that points the user at the HTTP path field.test_validate_credentials_maps_connection_errorsparameterized test with a case for it.How did you test this code?
Extended the existing parameterized
test_validate_credentials_maps_connection_errorstest with aRESOURCE_DOES_NOT_EXISTcase. It catches the regression where that mapping is dropped or mis-keyed and a wrong/deleted warehouse silently reverts to the generic message. Ran the test locally, all 7 cases pass. Also ran ruff check and format over the touched files.🤖 Agent context
Autonomy: Fully autonomous
I (Claude) triaged a day of Databricks warehouse-source-creation failures and found they were all the generic "could not connect" fallback. Comparing the validate-time and sync-time error maps surfaced the missing
RESOURCE_DOES_NOT_EXISTentry as a concrete, minimal fix. I kept the change to a single mapping plus one parameterized test case rather than broadening the reused message from the sync map, since that map's wording tells users to "resync" which is wrong in the create flow. Invoked the/writing-testsskill before adding the test.Created with PostHog Code