Gordon Silvera
11/08/2022, 2:51 PMAttributeError: module 'prefect.tasks' has no attribute 'dbt'
. I've tried to run this locally and within the jupyter-scipy Docker image. Any thoughts why Prefect cannot find the module?
# dbt_shell_task.py
import sys
import prefect
from prefect import task, flow, get_run_logger
@flow
def dbt_flow(cmd='dbt run'):
# Execute specified command
task = prefect.tasks.dbt.dbt.DbtShellTask(
command=cmd,
profile_name='default',
environment='Development',
dbt_kwargs={'type': 'bigquery'},
overwrite_profiles=False,
profiles_dir='/home/jovyan/.dbt/profiles.yml'
)
logger = get_run_logger()
<http://logger.info|logger.info>("Command Run: %s!", name)
return task
if __name__ == "__main__":
cmd = sys.argv[1]
dbt_flow(cmd)
# packages
prefect==2.6.6
prefect-dbt==0.2.4
prefect-shell==0.1.3
dbt-bigquery==1.3.0
dbt-core==1.3.0
dbt-extractor==0.4.1
Jeff Hale
11/08/2022, 6:48 PMGordon Silvera
11/08/2022, 7:52 PMBring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by