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
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def __init__(
**kwargs: Any,
) -> None:
kwargs.pop("output_type", None)
if kwargs.get("require_approval"):
raise ValueError("require_approval=True is not supported by LLMBranchOperator.")
super().__init__(**kwargs)
self.allow_multiple_branches = allow_multiple_branches

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def __init__(
**kwargs: Any,
) -> None:
kwargs.pop("output_type", None)
if kwargs.get("require_approval"):
raise ValueError("require_approval=True is not supported by LLMSchemaCompareOperator.")
super().__init__(**kwargs)
self.data_sources = data_sources or []
self.db_conn_ids = db_conn_ids or []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ def test_output_type_ignored(self):
# the real output_type is built dynamically from downstream_task_ids
assert op.output_type is str

def test_require_approval_rejected(self):
with pytest.raises(ValueError, match="require_approval=True is not supported"):
LLMBranchOperator(
task_id="test",
prompt="pick a branch",
llm_conn_id="my_llm",
require_approval=True,
)

@patch.object(LLMBranchOperator, "do_branch")
@patch("airflow.providers.common.ai.operators.llm.PydanticAIHook", autospec=True)
def test_execute_single_branch(self, mock_hook_cls, mock_do_branch):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class TestLLMSchemaCompareOperator:
"at-least two combinations",
id="one_datasource_only",
),
pytest.param(
{"require_approval": True},
"require_approval=True is not supported",
id="require_approval",
),
],
)
def test_init_validation(self, kwargs, expected_error):
Expand Down
Loading