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 @@ -227,6 +227,8 @@ class HITLEntryOperator(HITLOperator):
def __init__(self, **kwargs) -> None:
if "options" not in kwargs:
kwargs["options"] = ["OK"]
kwargs["defaults"] = ["OK"]

if "defaults" not in kwargs:
kwargs["defaults"] = ["OK"]

super().__init__(**kwargs)
26 changes: 25 additions & 1 deletion providers/standard/tests/unit/standard/operators/test_hitl.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_execute_complete_with_downstream_tasks(self, dag_maker) -> None:


class TestHITLEntryOperator:
def test_init(self) -> None:
def test_init_without_options_and_default(self) -> None:
op = HITLEntryOperator(
task_id="hitl_test",
subject="This is subject",
Expand All @@ -267,3 +267,27 @@ def test_init(self) -> None:

assert op.options == ["OK"]
assert op.defaults == ["OK"]

def test_init_without_options(self) -> None:
op = HITLEntryOperator(
task_id="hitl_test",
subject="This is subject",
body="This is body",
params={"input": 1},
defaults=None,
)

assert op.options == ["OK"]
assert op.defaults is None

def test_init_without_default(self) -> None:
op = HITLEntryOperator(
task_id="hitl_test",
subject="This is subject",
body="This is body",
params={"input": 1},
options=["OK", "NOT OK"],
)

assert op.options == ["OK", "NOT OK"]
assert op.defaults is None