Created
October 29, 2022 20:35
-
-
Save anna-geller/d7e6ecc1c03eb12b458fbf6988efc399 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from prefect import flow | |
from prefect_dbt.cli.commands import trigger_dbt_cli_command | |
from prefect_dbt.cli.credentials import DbtCliProfile | |
def dbt(command: str = "dbt debug") -> None: | |
trigger_dbt_cli_command.with_options(name=command)( | |
command, | |
project_dir=Path(__file__) | |
.parent.parent.parent.parent.joinpath("dbt_jaffle_shop") | |
.expanduser(), | |
overwrite_profiles=True, | |
dbt_cli_profile=DbtCliProfile.load("default"), | |
) | |
@flow | |
def dbt_jaffle_shop(dbt_command: str = "dbt build"): | |
dbt(dbt_command) | |
if __name__ == "__main__": | |
dbt_jaffle_shop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment