Skip to content

Commit

Permalink
Logging the error when failing to retrieve elementary dbt pkg version.
Browse files Browse the repository at this point in the history
  • Loading branch information
elongl committed Dec 29, 2022
1 parent 2b99043 commit 9763a3d
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,27 @@ def setup_env(

def install_edr(adapter: str):
logging.info("Getting Elementary dbt package version.")
dbt_pkg_ver = (
subprocess.run(
[
"dbt",
"-q",
"run-operation",
"get_elementary_dbt_pkg_version",
"--project-dir",
"/edr_stager_dbt_project",
],
check=True,
capture_output=True,
try:
dbt_pkg_ver = (
subprocess.run(
[
"dbt",
"-q",
"run-operation",
"get_elementary_dbt_pkg_version",
"--project-dir",
"/edr_stager_dbt_project",
],
check=True,
capture_output=True,
)
.stdout.decode()
.strip()
)
.stdout.decode()
.strip()
)
except subprocess.CalledProcessError as err:
logging.error(f"Failed to get Elementary dbt package version: {vars(err)}")
raise

if not dbt_pkg_ver:
logging.info(
"Unable to get Elementary's dbt package version. Installing latest edr."
Expand Down

0 comments on commit 9763a3d

Please sign in to comment.