Skip to content

Commit

Permalink
fix: by default, refrain adding dna tables to duckdb
Browse files Browse the repository at this point in the history
  • Loading branch information
matinnuhamunada committed Feb 18, 2024
1 parent 8784787 commit 27b3a21
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions workflow/rules/build-database.smk
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ rule get_dbt_template:
python {params.dbt}/scripts/source_template.py {params.dbt}/templates/_sources.yml {output.profile} {params.as_version} {params.cutoff} &>> {log}
"""

def exclude_model_dbt(model_to_ignore):
def exclude_model_dbt(model_to_ignore, exclude_dna_sequences=True):
"""
Returns a string containing the `--exclude` option followed by the models to ignore in a dbt project.
Expand All @@ -144,6 +144,9 @@ def exclude_model_dbt(model_to_ignore):
Note:
The returned string can be used as an argument to the `dbt build` command to exclude the specified models from the build process.
"""
if exclude_dna_sequences:
model_to_ignore.append("dna_sequences")

if len(model_to_ignore) == 0:
return ""
else:
Expand All @@ -160,7 +163,7 @@ rule build_database:
threads: 16
params:
dbt = "data/processed/{name}/dbt/antiSMASH_{version}",
exclude = lambda wildcards: exclude_model_dbt(models_to_ignore[wildcards.name])
exclude = lambda wildcards: exclude_model_dbt(models_to_ignore[wildcards.name]),
shell:
"""
command="dbt build --threads {threads} {params.exclude} -x"
Expand Down

0 comments on commit 27b3a21

Please sign in to comment.