fix: provide default mock for SPOG probe to avoid network calls in unit tests (closes #1274)#1502
Closed
botbikamordehai2-sketch wants to merge 1 commit into
Closed
Conversation
Collaborator
|
I don't this is the correct fix, the code changes specifically affect spog unit tests while the issue is for |
Collaborator
|
Hi @botbikamordehai2-sketch I am closing the PR as I had already resolved #1274 independently in #1474, which was merged to |
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.
What
When using a mocked Databricks profile (e.g., for Cosmos DAG generation in CI),
dbt lsfails because the SPOG probe attempts a real HTTP connection to the Databricks endpoint. The test fixture_guard_unmocked_requests_getwas designed to catch unmocked requests but actually prevents any test from running without explicitly patching, causing failures when no test-level mock is applied.Fix
Replace the
side_effect=AssertionError(...)with a default mock that returns a 200 OK response. This ensures that SPOG probe calls are silently handled in unit tests when no explicit mock is provided, while still allowing tests to override the mock if needed.Closes #1274