Skip to content

Commit

Permalink
Show RunnerError using fmt.error_style
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Mar 25, 2024
1 parent c8d5e1e commit ed77120
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dlt/cli/run_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def run_pipeline_command(
except PipelineStepFailed:
raise
except RunnerError as ex:
fmt.echo(ex.message)
fmt.echo(fmt.error_style(ex.message))
return -1
except (FriendlyExit, PreflightError):
fmt.info("Stopping...")
Expand Down
11 changes: 2 additions & 9 deletions dlt/common/cli/runner/pipeline_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ def load_module(self, script_path: str) -> ModuleType:
spec.loader.exec_module(module)
if self.has_pipeline_auto_runs:
raise RunnerError(
fmt.style(
"Please move all pipeline.run calls inside __main__ or remove them",
fg="red",
)
"Please move all pipeline.run calls inside __main__ or remove them"
)

return module
Expand Down Expand Up @@ -141,11 +138,7 @@ def pipeline_members(self) -> PipelineMembers:
if value._args_bound:
members["sources"][name] = value
else:
fmt.echo(
fmt.info_style(
f"Resource: {value.name} is not bound, skipping."
)
)
fmt.echo(fmt.info_style(f"Resource: {value.name} is not bound, skipping."))

return members

Expand Down

0 comments on commit ed77120

Please sign in to comment.