Skip to content

Commit

Permalink
Add logging and abort when no dbt downstream tables are found
Browse files Browse the repository at this point in the history
  • Loading branch information
ynaim94-harrys committed Jun 8, 2022
1 parent 85a8d87 commit 00d1be4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ RUN yum install -y \
jq \
libyaml-devel \
openssh-clients \
passwd \
postgresql \
procps-ng \
python3 \
python3-devel \
sudo \
tar \
tmux \
vim-minimal \
sudo \
passwd
vim-minimal

RUN amazon-linux-extras install docker

# Run as non-priviledged user "arthur".
RUN useradd --comment 'Arthur ETL' --user-group --create-home arthur && \
RUN useradd --comment 'Arthur ETL' --user-group --groups wheel --create-home arthur && \
mkdir --parent /opt/data-warehouse "/opt/local/$PROJ_NAME" /opt/src/arthur-redshift-etl && \
chown -R arthur.arthur /opt/*

RUN echo "arthur:arthur" | chpasswd
RUN usermod -aG wheel arthur

USER arthur

Expand Down
4 changes: 4 additions & 0 deletions python/etl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,11 @@ def callback(self, args):
dbt_downstream_parents = " ".join(
[f"{parent}+" for parent in dbt_project.show_downstream_dbt_parents(dbt_model_identifiers)]
)
if not dbt_downstream_parents:
logging.info("No dbt downstream dependents found")
return

logging.info("dbt downstream dependents found")
dbt_project.build_image()
dbt_stdout = dbt_project.run_cmd(
f"dbt list -t dev --exclude redshift --output json "
Expand Down

0 comments on commit 00d1be4

Please sign in to comment.