Skip to content

Commit 6cff579

Browse files
committed
Fixed serialisation bug
1 parent c260527 commit 6cff579

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

causal_testing/testing/causal_test_result.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ def to_dict(self, json=False):
8585
"outcome": self.estimator.outcome,
8686
"adjustment_set": list(self.adjustment_set) if json else self.adjustment_set,
8787
"effect_measure": self.test_value.type,
88-
"effect_estimate": self.test_value.value,
89-
"ci_low": self.ci_low(),
90-
"ci_high": self.ci_high(),
88+
"effect_estimate": self.test_value.value.to_dict()
89+
if json and hasattr(self.test_value.value, "to_dict")
90+
else self.test_value.value,
91+
"ci_low": self.ci_low().to_dict() if json and hasattr(self.ci_low(), "to_dict") else self.ci_low(),
92+
"ci_high": self.ci_high().to_dict() if json and hasattr(self.ci_high(), "to_dict") else self.ci_high(),
9193
}
9294
if self.adequacy:
9395
base_dict["adequacy"] = self.adequacy.to_dict()

0 commit comments

Comments
 (0)