Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cosmos/operators/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
task_id = kwargs.pop("task_id", PRODUCER_WATCHER_TASK_ID)
self.tests_per_model: dict[str, list[str]] = kwargs.pop("tests_per_model", {})
self.test_results_per_model: dict[str, list[str]] = {}
# Do not publish compiled_sql to the producer's rendered_template: it would contain SQL for
# all models run by the producer, is often truncated in the UI due to size, and is of no use
# there; individual sensor tasks show the corresponding rendered_template per model.
kwargs["should_store_compiled_sql"] = False
Comment thread
pankajkoti marked this conversation as resolved.
kwargs.setdefault("priority_weight", PRODUCER_WATCHER_DEFAULT_PRIORITY_WEIGHT)
kwargs.setdefault("weight_rule", WATCHER_TASK_WEIGHT_RULE)
# Consumer watcher retry logic handles model-level reruns using the LOCAL execution mode; rerunning the producer
Expand Down
6 changes: 6 additions & 0 deletions tests/operators/test_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ def test_dbt_producer_watcher_operator_priority_weight_default():
assert op.priority_weight == PRODUCER_WATCHER_DEFAULT_PRIORITY_WEIGHT


def test_dbt_producer_watcher_operator_does_not_store_compiled_sql_on_template():
"""Producer does not publish compiled_sql to its rendered_template; sensors show it per model."""
op = DbtProducerWatcherOperator(project_dir=".", profile_config=None)
assert op.should_store_compiled_sql is False


Comment thread
pankajkoti marked this conversation as resolved.
@pytest.mark.parametrize(
"queue_override, expected_queue",
[
Expand Down