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

Display exception message on deploy command failure #2204

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
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
11 changes: 6 additions & 5 deletions dlt/cli/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
SecretFormats,
)

deploy_command_available = True
except ModuleNotFoundError:
deploy_command_available = False
deploy_command_import_exception = None
except ModuleNotFoundError as exc:
deploy_command_import_exception = exc


@plugins.hookspec()
Expand Down Expand Up @@ -316,7 +316,7 @@ def configure_parser(self, parser: argparse.ArgumentParser) -> None:
"pipeline_script_path", metavar="pipeline-script-path", help="Path to a pipeline script"
)

if not deploy_command_available:
if deploy_command_import_exception:
return

deploy_comm.add_argument(
Expand Down Expand Up @@ -375,7 +375,8 @@ def configure_parser(self, parser: argparse.ArgumentParser) -> None:

def execute(self, args: argparse.Namespace) -> None:
# exit if deploy command is not available
if not deploy_command_available:
if deploy_command_import_exception:
fmt.error(str(deploy_command_import_exception))
fmt.warning(
"Please install additional command line dependencies to use deploy command:"
)
Expand Down
Loading