Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(bigquery-connection): Fix chain authen logic when we try to create bigquery client #405

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/vanna/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down