diff --git a/src/vanna/base/base.py b/src/vanna/base/base.py index 426a33a1..53e1f675 100644 --- a/src/vanna/base/base.py +++ b/src/vanna/base/base.py @@ -1146,19 +1146,14 @@ def connect_to_bigquery(self, cred_file_path: str = None, project_id: str = None conn = None - try: - conn = bigquery.Client(project=project_id) - except: - print("Could not found any google cloud implicit credentials") - - if cred_file_path: + if not cred_file_path: + try: + conn = bigquery.Client(project=project_id) + except: + print("Could not found any google cloud implicit credentials") + else: # Validate file path and pemissions validate_config_path(cred_file_path) - else: - if not conn: - raise ValidationError( - "Pleae provide a service account credentials json file" - ) if not conn: with open(cred_file_path, "r") as f: