-
Notifications
You must be signed in to change notification settings - Fork 122
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
Updates to warehouse-per-model logging and tests #511
Conversation
Updated the debug logging for warehouse-per-model to include thread id and relation name. Updated the warehouse-per-model functional test to include a seed and a snapshot that specify an alternate compute. Changed the test conditions to include checking log output for messages that indicate the alternate compute was used. Signed-off-by: Raymond Cypher <[email protected]>
@@ -1120,21 +1121,31 @@ def _get_compute_name(node: Optional[ResultNode]) -> Optional[str]: | |||
|
|||
|
|||
def _get_http_path(node: Optional[ResultNode], creds: DatabricksCredentials) -> Optional[str]: | |||
thread_id = (os.getpid(), get_ident()) | |||
# Get the http path of the compute resource specified in the node's config. | |||
# If none is specified return the default path from creds. | |||
compute_name = _get_compute_name(node) | |||
if not node or not compute_name: |
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.
This structure has become a little weird. I believe we can drop the if not node
.
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.
maybe we can't due to the creds.http_path. Still, worth thinking about restructuring because its so odd to check if something is not, and then immediately check if it is.
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.
Given this weirdness, let's add either a unit test or an end to end test that validates we do the expected thing in the default compute case.
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.
I agree that if not node or not compute_name:
is an odd structure. However I originally did it that way because using just if not compute_name:
produced linting errors. I'll re-organize things.
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.
I think the existing unit tests cover all the possibilities for what can be passed in to _get_http_path
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.
Please add a test validating that we use the default case as expected when in an env where we have some models with specified compute and some without.
Updated functional tests to add a model using the default compute alongside models using alternate compute. Updated the error message for when a named compute does not exist or does not specify http_path. Clarified the logic in _get_http_path() Signed-off-by: Raymond Cypher <[email protected]>
Description
Checklist
CHANGELOG.md
and added information about my change to the "dbt-databricks next" section.