Skip to content

Commit

Permalink
Update to support properly
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDee committed Feb 7, 2025
1 parent 55e0df1 commit cf339d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/dbt/task/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ class ShowTaskDirect(ConfiguredTask):
def run(self):
adapter = get_adapter(self.config)
with adapter.connection_named("show", should_release_connection=False):
response, table = adapter.execute(
self.args.inline_direct, fetch=True, limit=self.args.limit
)
limit = None if self.args.limit < 0 else self.args.limit
response, table = adapter.execute(self.args.inline_direct, fetch=True, limit=limit)

output = io.StringIO()
if self.args.output == "json":
Expand Down
10 changes: 10 additions & 0 deletions tests/functional/show/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ def test_inline_direct_pass_quiet(self, project):
# See prior test for explanation of why this is here
run_dbt(["seed"])

def test_inline_direct_pass_no_limit(self, project):
query = f"select * from {project.test_schema}.sample_seed"
(_, log_output) = run_dbt_and_capture(["show", "--inline-direct", query, "--limit", -1])
assert "Previewing inline node" in log_output
assert "sample_num" in log_output
assert "sample_bool" in log_output

# See prior test for explanation of why this is here
run_dbt(["seed"])


class TestShowInlineDirectFail(ShowBase):

Expand Down

0 comments on commit cf339d6

Please sign in to comment.