Skip to content

Commit

Permalink
rename show macro, pass kwargs explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 25, 2023
1 parent 1ebfd74 commit 7c118f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/dbt/include/global_project/macros/adapters/show.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% macro show(limit) -%}
{%- set sql_header = config.get('sql_header', none) -%}
{% macro get_show_sql(compiled_code, sql_header, limit) -%}
{%- set sql_header = sql_header -%}
{{ sql_header if sql_header is not none }}
{%- if limit is not none -%}
{{ get_limit_subquery_sql(compiled_code, limit) }}
Expand Down
8 changes: 6 additions & 2 deletions core/dbt/task/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ def execute(self, compiled_node, manifest):

model_context = generate_runtime_model_context(compiled_node, self.config, manifest)
compiled_node.compiled_code = self.adapter.execute_macro(

Check warning on line 28 in core/dbt/task/show.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/show.py#L27-L28

Added lines #L27 - L28 were not covered by tests
macro_name="show",
macro_name="get_show_sql",
manifest=manifest,
context_override=model_context,
kwargs={"limit": limit},
kwargs={
"compiled_code": model_context["compiled_code"],
"sql_header": model_context["config"].get("sql_header"),
"limit": limit,
},
)
adapter_response, execute_result = self.adapter.execute(
compiled_node.compiled_code, fetch=True
Expand Down

0 comments on commit 7c118f7

Please sign in to comment.