Skip to content

Commit

Permalink
Merge branch 'staging/include_dbt_test' of https://github.com/basedos…
Browse files Browse the repository at this point in the history
…dados/pipelines into staging/include_dbt_test
  • Loading branch information
laura-l-amaral committed Sep 28, 2023
2 parents 3479714 + 1af50a0 commit 1aca212
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions pipelines/utils/execute_dbt_model/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
table_id = Parameter("table_id")
mode = Parameter("mode", default="dev", required=False)
dbt_alias = Parameter("dbt_alias", default=False, required=False)
dbt_command = Parameter("dbt_command", default='run', required=False)
dbt_command = Parameter("dbt_command", default="run", required=False)

################# ####################
#
Expand All @@ -40,10 +40,9 @@
table_id=table_id,
dbt_alias=dbt_alias,
sync=True,
dbt_command=dbt_command
dbt_command=dbt_command,
)



run_dbt_model_flow.storage = GCS(constants.GCS_FLOWS_BUCKET.value)
run_dbt_model_flow.run_config = KubernetesRun(image=constants.DOCKER_IMAGE.value)
8 changes: 4 additions & 4 deletions pipelines/utils/execute_dbt_model/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

from dbt_client import DbtClient
from prefect import task
from pipelines.utils.utils import log

from pipelines.constants import constants
from pipelines.utils.execute_dbt_model.utils import get_dbt_client
from pipelines.utils.utils import log


@task(
Expand Down Expand Up @@ -55,7 +55,7 @@ def run_dbt_model(
if dbt_alias:
table_id = f"{dataset_id}__{table_id}"

if 'run' in dbt_command:
if "run" in dbt_command:
logs_dict = dbt_client.cli(
f"run --models {dataset_id}.{table_id}",
sync=sync,
Expand All @@ -68,8 +68,8 @@ def run_dbt_model(
if "On model" in event["message"]:
log(event["message"])

if 'test' in dbt_command:
logs_dict = dbt_client.cli(
if "test" in dbt_command:
logs_dict = dbt_client.cli(
f"test --models {dataset_id}.{table_id}",
sync=sync,
logs=True,
Expand Down
2 changes: 1 addition & 1 deletion pipelines/utils/execute_dbt_model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def generate_execute_dbt_model_schedules( # pylint: disable=too-many-arguments,
parameter_defaults=parameter_defaults,
)
)
return clocks
return clocks

0 comments on commit 1aca212

Please sign in to comment.