Skip to content
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

fix BaseMacroArgsQueryComments by removing ref to dbt_version in fixture #184

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading