Skip to content

Commit 2c76f75

Browse files
committed
Fix - from_service_account_json is a classmethod
1 parent 8dd88e0 commit 2c76f75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pybigquery/sqlalchemy_bigquery.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ def dbapi(cls):
103103
return dbapi
104104

105105
def create_connect_args(self, url):
106-
project = url.host
107106
if self.credentials_path:
108-
client = bigquery.Client(project).from_service_account_json(self.credentials_path)
107+
client = bigquery.Client.from_service_account_json(self.credentials_path)
109108
else:
110-
client = bigquery.Client(project)
109+
client = bigquery.Client(url.host)
111110
return ([client], {})
112111

113112
def _split_table_name(self, full_table_name):

0 commit comments

Comments
 (0)