From f36471694f03000e61bf1f8b3a75a60c72da3f4f Mon Sep 17 00:00:00 2001 From: Rafalz13 Date: Wed, 11 Oct 2023 14:59:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Added=20trigger=20and=20cleaned?= =?UTF-8?q?=20up=20docstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- viadot/flows/transform_and_catalog.py | 4 ++-- viadot/tasks/luma.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/viadot/flows/transform_and_catalog.py b/viadot/flows/transform_and_catalog.py index 3019cd956..1de5c4430 100644 --- a/viadot/flows/transform_and_catalog.py +++ b/viadot/flows/transform_and_catalog.py @@ -10,7 +10,7 @@ from viadot.tasks import CloneRepo, AzureKeyVaultSecret, LumaIngest -@task() +@task(trigger=any_successful) def _cleanup_repo(dbt_repo_dir_name: str) -> None: """ Remove a repo folder. @@ -23,7 +23,7 @@ def _cleanup_repo(dbt_repo_dir_name: str) -> None: @task(trigger=any_successful) def custom_shell_task(name: str, command: str, helper_script: str = None) -> None: - """_ + """ Task created to run ShellTask and apply `trigger` on it. For regular ShellTask it is not possible. Args: diff --git a/viadot/tasks/luma.py b/viadot/tasks/luma.py index f1df5d3a7..f9dfe9016 100644 --- a/viadot/tasks/luma.py +++ b/viadot/tasks/luma.py @@ -1,7 +1,6 @@ import json - from prefect.tasks.shell import ShellTask - +from prefect.triggers import any_successful from .azure_key_vault import AzureKeyVaultSecret @@ -41,9 +40,7 @@ def __init__( self.helper_script = dbt_project_path self.url = url self.metadata_dir_path = metadata_dir_path - self.command = ( - f"luma dbt send-test-results --luma-url {url} --metadata-dir {metadata_dir_path}" - ) + self.command = f"luma dbt send-test-results --luma-url {url} --metadata-dir {metadata_dir_path}" self.return_all = True self.stream_output = True self.log_stderr = True