From 78c7efc9af26144c206c06fd6d1ac7c73830daea Mon Sep 17 00:00:00 2001 From: Zain Hoda <7146154+zainhoda@users.noreply.github.com> Date: Wed, 21 Aug 2024 11:19:36 -0400 Subject: [PATCH] isolate changes to the postgres method --- src/vanna/base/base.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/vanna/base/base.py b/src/vanna/base/base.py index 78b167f3..e8e0bbf9 100644 --- a/src/vanna/base/base.py +++ b/src/vanna/base/base.py @@ -464,7 +464,7 @@ def get_training_data(self, **kwargs) -> pd.DataFrame: pass @abstractmethod - def remove_training_data(id: str, **kwargs) -> bool: + def remove_training_data(self, id: str, **kwargs) -> bool: """ Example: ```python @@ -1322,15 +1322,9 @@ def connect_to_bigquery( def run_sql_bigquery(sql: str) -> Union[pd.DataFrame, None]: if conn: - try: - job = conn.query(sql) - df = job.result().to_dataframe() - return df - except GoogleAPIError as error: - errors = [] - for error in error.errors: - errors.append(error["message"]) - raise errors + job = conn.query(sql) + df = job.result().to_dataframe() + return df return None self.dialect = "BigQuery SQL"