Skip to content

Commit

Permalink
boolean inversion
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Sep 6, 2023
1 parent 79d8e9b commit 4152a24
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/dbt/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def docs_serve(ctx, **kwargs):
@p.state
@p.defer_state
@p.deprecated_state
@p.compile_suppress_ephemeral_ctes
@p.compile_inject_ephemeral_ctes
@p.target
@p.target_path
@p.threads
Expand Down
10 changes: 5 additions & 5 deletions core/dbt/cli/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@
default=True,
)

compile_suppress_ephemeral_ctes = click.option(
"--suppress-ephemeral-ctes/--no-suppress-ephemeral-ctes",
envvar="DBT_SUPPRESS_EPHEMERAL_CTES",
help="Internal flag for whether to supress injecting referenced ephemeral models' CTEs during `compile`.",
compile_inject_ephemeral_ctes = click.option(
"--inject-ephemeral-ctes/--no-inject-ephemeral-ctes",
envvar=None,
help="Internal flag controlling injection of referenced ephemeral models' CTEs during `compile`.",
hidden=True,
default=False,
default=True,
)

config_dir = click.option(
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def _recursively_prepend_ctes(
raise DbtRuntimeError("Cannot inject ctes into an uncompiled node", model)

# tech debt: safe flag/arg access (#6259)
if getattr(self.config.args, "suppress_ephemeral_ctes", False):
if not getattr(self.config.args, "inject_ephemeral_ctes", True):
return (model, [])

# extra_ctes_injected flag says that we've already recursively injected the ctes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_ephemeral_compilation(self, project):

def test__suppress_injected_ctes(self, project):
compile_output = run_dbt(
["compile", "--suppress-ephemeral-ctes", "--select", "fct_eph_first"]
["compile", "--no-inject-ephemeral-ctes", "--select", "fct_eph_first"]
)
assert isinstance(compile_output, RunExecutionResult)
node_result = compile_output.results[0]
Expand Down

0 comments on commit 4152a24

Please sign in to comment.