Skip to content

Commit a9d17b8

Browse files
committed
fix: threshold reduction in CappedMinCount
1 parent e9ce71e commit a9d17b8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

execution_engine/task/task.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ def interval_counts(
447447
elif interval.type == IntervalType.NOT_APPLICABLE:
448448
not_applicable_count += 1
449449
# we require at least one positive interval to be present in any case (hence the max(1, ...))
450-
effective_count_min = max(1, self.expr.count_min - not_applicable_count) # type: ignore[attr-defined]
450+
effective_count_min = min(
451+
self.expr.count_min, max(1, len(intervals) - not_applicable_count) # type: ignore[attr-defined]
452+
)
451453
if positive_count >= effective_count_min:
452454
effective_type = IntervalType.POSITIVE
453455
else:

execution_engine/util/logic.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,14 @@ class LeftDependentToggle(BinaryNonCommutativeOperator):
10111011
"""
10121012
A LeftDependentToggle object represents a logical AND operation if the left operand is positive,
10131013
otherwise it returns NOT_APPLICABLE.
1014+
1015+
| left | right | Result |
1016+
|----------|----------|----------|
1017+
| NEGATIVE | * | NOT_APPLICABLE |
1018+
| NO_DATA | * | NOT_APPLICABLE |
1019+
| POSITIVE | POSITIVE | POSITIVE |
1020+
| POSITIVE | NEGATIVE | NEGATIVE |
1021+
| POSITIVE | NO_DATA | NO_DATA |
10141022
"""
10151023

10161024

@@ -1019,7 +1027,6 @@ class ConditionalFilter(BinaryNonCommutativeOperator):
10191027
A ConditionalFilter object returns the right operand if the left operand is POSITIVE,
10201028
and NEGATIVE otherwise
10211029
1022-
10231030
A conditional filter returns `right` iff `left` is POSITIVE, otherwise NEGATIVE.
10241031
10251032
| left | right | Result |

0 commit comments

Comments
 (0)