From a0b9af310955cb663a197c90b45fb9c5f233a4d5 Mon Sep 17 00:00:00 2001 From: Josh Temple <8672171+joshtemple@users.noreply.github.com> Date: Thu, 17 Aug 2023 10:43:09 -0400 Subject: [PATCH] Make SQL in the SQL error optional --- spectacles/exceptions.py | 2 +- spectacles/types.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spectacles/exceptions.py b/spectacles/exceptions.py index 16c3a673..065eb4cd 100644 --- a/spectacles/exceptions.py +++ b/spectacles/exceptions.py @@ -135,7 +135,7 @@ def __init__( model: str, explore: str, dimension: Optional[str], - sql: str, + sql: Optional[str], message: str, line_number: Optional[int] = None, explore_url: Optional[str] = None, diff --git a/spectacles/types.py b/spectacles/types.py index c4576369..50e23031 100644 --- a/spectacles/types.py +++ b/spectacles/types.py @@ -61,7 +61,7 @@ class ErrorData(BaseModel): class MultiErrorData(BaseModel): id: str runtime: float - sql: str + sql: Optional[str] errors: Optional[Tuple[QueryError, ...]] status: Literal["error"] @@ -72,7 +72,7 @@ def runtime(self) -> float: return self.data.runtime @property - def sql(self) -> str: + def sql(self) -> Optional[str]: return self.data.sql @property