Skip to content

Commit

Permalink
fix BaseMacroArgsQueryComments by removing ref to dbt_version in fixt…
Browse files Browse the repository at this point in the history
…ure (#184)
  • Loading branch information
colin-rogers-dbt committed Apr 23, 2024
1 parent b61d66d commit 596b44c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240423-094843.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: remove dbt_version from query comment test fixture
time: 2024-04-23T09:48:43.208035-07:00
custom:
Author: colin-rogers-dbt
Issue: "184"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{%- set comment_dict = dict(
app='dbt++',
macro_version='0.1.0',
dbt_version=dbt_version,
message='blah: '~ message) -%}
{{ return(comment_dict) }}
{%- endmacro -%}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
from importlib import import_module

import pytest
from dbt_common.exceptions import DbtRuntimeError
Expand Down Expand Up @@ -53,19 +52,15 @@ def test_matches_comment(self, project):


class BaseMacroArgsQueryComments(BaseDefaultQueryComments):
@pytest.fixture(scope="class")
def get_package_version(self, project):
return import_module("." + project.adapter_type, "dbt.adapters").__version__.version

@pytest.fixture(scope="class")
def project_config_update(self):
return {"query-comment": "{{ return(ordered_to_json(query_header_args(target.name))) }}"}

def test_matches_comment(self, project, get_package_version):
def test_matches_comment(self, project):
logs = self.run_get_json()
expected_dct = {
"app": "dbt++",
"dbt_version": get_package_version,
"macro_version": "0.1.0",
"message": f"blah: {project.adapter.config.target_name}",
}
Expand Down

0 comments on commit 596b44c

Please sign in to comment.