Initial publish of dbt_f2dq (f2dq) package v0.12.1.
Clean package repo for Gitea installs via packages.yml git URL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
import yaml
|
||||
|
||||
def dbt_command(command, for_db, dbt_vars, threads=None):
|
||||
debug = 'DBT_MACRO_DEBUGGING=1 '
|
||||
profile_part = f' --profile f2dq_{for_db}'
|
||||
yaml_vars = yaml.dump(dbt_vars)
|
||||
cmd = f'{debug} {command} --vars "{yaml_vars}" {profile_part}'
|
||||
if threads:
|
||||
cmd += f' --threads {threads}'
|
||||
assert os.system(cmd) == 0
|
||||
|
||||
def dbt_seed(args, for_db, dbt_vars):
|
||||
dbt_command(f'dbt seed --full-refresh {args}', for_db, dbt_vars, threads=4)
|
||||
|
||||
def dbt_run(args, for_db, dbt_vars):
|
||||
dbt_command(f'dbt run --full-refresh --fail-fast {args}', for_db, dbt_vars, threads=4)
|
||||
|
||||
def dbt_test(args, for_db, dbt_vars):
|
||||
dbt_command(f'dbt test --store-failures --fail-fast {args}', for_db, dbt_vars, threads=4)
|
||||
|
||||
def dbt_build(args, for_db, dbt_vars):
|
||||
dbt_command(f'dbt build --full-refresh --store-failures --fail-fast {args}', for_db, dbt_vars, threads=4)
|
||||
Reference in New Issue
Block a user