Skip to content

Commit

Permalink
isolate changes to the postgres method
Browse files Browse the repository at this point in the history
  • Loading branch information
zainhoda committed Aug 21, 2024
1 parent dad1f41 commit 78c7efc
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/vanna/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 78c7efc

Please sign in to comment.