Skip to content

Commit 4badf31

Browse files
committed
dont deserialize twice
1 parent d3c8eb4 commit 4badf31

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

guardrails/validator_service/validator_service_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ def merge_results(self, original_value: Any, new_values: list[Any]) -> Any:
195195
serialize(current), serialize(nextval), serialize(original_value)
196196
)
197197
current = deserialize(original_value, current)
198-
deserialized_value = deserialize(original_value, current)
199-
if deserialized_value is None and current is not None:
198+
if current is None and original_value is not None:
200199
# QUESTION: How do we escape hatch
201200
# for when deserializing the merged value fails?
202201

@@ -205,4 +204,4 @@ def merge_results(self, original_value: Any, new_values: list[Any]) -> Any:
205204

206205
# Or just pick one of the new values?
207206
return new_vals[0]
208-
return deserialized_value
207+
return current

0 commit comments

Comments
 (0)