Skip to content

Commit f8355c5

Browse files
authored
fix: Typo in template field (#130)
* test: Add test for dbt ls with default resource types * fix: Typo in template field
1 parent 2028102 commit f8355c5

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

airflow_dbt_python/operators/dbt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ class DbtLsOperator(DbtBaseOperator):
519519
"""
520520

521521
template_fields = (
522-
base_template_fields + selection_template_fields + ["resource_type"]
522+
base_template_fields + selection_template_fields + ["resource_types"]
523523
)
524524

525525
def __init__(

tests/operators/test_dbt_list.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,41 @@ def test_dbt_ls_all(
8686
]
8787

8888
assert all_files == expected
89+
90+
91+
def test_dbt_ls_all_with_default(
92+
profiles_file,
93+
dbt_project_file,
94+
seed_files,
95+
model_files,
96+
singular_tests_files,
97+
generic_tests_files,
98+
snapshot_files,
99+
):
100+
"""Test dbt list operator by listing all resources."""
101+
op = DbtLsOperator(
102+
task_id="dbt_task",
103+
project_dir=dbt_project_file.parent,
104+
profiles_dir=profiles_file.parent,
105+
do_xcom_push=True,
106+
)
107+
all_files = op.execute({})
108+
109+
expected = [
110+
"test.model_1",
111+
"test.model_2",
112+
"test.model_3",
113+
"test.model_4",
114+
"test.seed_1",
115+
"test.seed_2",
116+
"test.snapshot_1.test_snapshot",
117+
"test.accepted_values_model_2_field1__123__456",
118+
"test.not_null_model_2_field1",
119+
"test.not_null_model_2_field2",
120+
"test.singular_test_1",
121+
"test.singular_test_2",
122+
"test.unique_model_2_field1",
123+
"test.unique_model_2_field2",
124+
]
125+
126+
assert all_files == expected

0 commit comments

Comments
 (0)