From 12f8bc486579943e2b930b434ed9d1ff0c78b33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20De=20Nef=20=2820002240=29?= Date: Wed, 15 Nov 2023 15:57:10 +0100 Subject: [PATCH] refactor: remove unreachable code in Datadog backend (#357) --- slo_generator/report.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/slo_generator/report.py b/slo_generator/report.py index 5235c7f5..2959e4ba 100644 --- a/slo_generator/report.py +++ b/slo_generator/report.py @@ -285,6 +285,8 @@ def _validate(self, data) -> bool: """ # Backend not found if data is None: + error = "Backend returned None." + self.errors.append(error) return False # Backend result is the wrong type @@ -352,12 +354,6 @@ def _validate(self, data) -> bool: self.errors.append(error) return False - # Check backend None - if data is None: - error = "Backend returned None." - self.errors.append(error) - return False - return True def _post_validate(self) -> bool: