Skip to content

Commit 9f5790a

Browse files
fix typing issue
1 parent c16ca9e commit 9f5790a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

guardrails/guard.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,10 +1167,12 @@ def _single_server_call(self, *, payload: Dict[str, Any]) -> ValidationOutcome[O
11671167
)
11681168
self.history.extend([Call.from_interface(call) for call in guard_history])
11691169

1170-
validator_logs = self.history.last.iterations.last.validator_logs
1171-
validation_summaries = ValidationSummary.from_validator_logs_only_fails(
1172-
validator_logs
1173-
)
1170+
validation_summaries = []
1171+
if self.history.last and self.history.last.iterations.last:
1172+
validator_logs = self.history.last.iterations.last.validator_logs
1173+
validation_summaries = ValidationSummary.from_validator_logs_only_fails(
1174+
validator_logs
1175+
)
11741176

11751177
# TODO: See if the below statement is still true
11761178
# Our interfaces are too different for this to work right now.

0 commit comments

Comments
 (0)