Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correct casting of run-operation args to str
When running a macro without arguments using DbtRunOperationOperator the args parameter was set to None. However, dbt always expects a string. So, now we always cast to string and have set the default to "{}", that matches dbt's default.
- Loading branch information
1 parent
c85a189
commit 37da708
Showing
7 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
"""Unit test module for running dbt run-operation with the DbtHook.""" | ||
|
||
|
||
def test_dbt_run_operation_task(hook, profiles_file, dbt_project_file, macro_file): | ||
def test_dbt_run_operation_task(hook, profiles_file, dbt_project_file, macro_name): | ||
"""Test a dbt run-operation task.""" | ||
factory = hook.get_config_factory("run-operation") | ||
config = factory.create_config( | ||
project_dir=dbt_project_file.parent, | ||
profiles_dir=profiles_file.parent, | ||
macro=str(macro_file.stem), | ||
macro=macro_name, | ||
args={"an_arg": 123}, | ||
) | ||
success, results = hook.run_dbt_task(config) | ||
assert success is True | ||
|
||
|
||
def test_dbt_run_operation_task_with_no_args( | ||
hook, profiles_file, dbt_project_file, non_arg_macro_name | ||
): | ||
"""Test a dbt run-operation task.""" | ||
factory = hook.get_config_factory("run-operation") | ||
config = factory.create_config( | ||
project_dir=dbt_project_file.parent, | ||
profiles_dir=profiles_file.parent, | ||
macro=non_arg_macro_name, | ||
) | ||
success, results = hook.run_dbt_task(config) | ||
assert success is True |
This file contains 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