File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,13 @@ def do_connect(
446
446
447
447
project_id = client_project_id or project_id or default_project_id
448
448
449
+ if project_id is None :
450
+ raise ValueError (
451
+ "Project ID could not be identified. "
452
+ "Provide either explicit `project_id`, `client` with project, "
453
+ "or don't provide an explicit `credentials` object."
454
+ )
455
+
449
456
(
450
457
self .data_project ,
451
458
self .billing_project ,
Original file line number Diff line number Diff line change @@ -274,3 +274,8 @@ def test_project_id_from_default(default_credentials):
274
274
# `connect()` re-evaluates default credentials and sets project_id since no client nor explicit project_id is provided
275
275
con = ibis .bigquery .connect ()
276
276
assert con .project_id == default_project_id
277
+
278
+
279
+ def test_project_id_missing (credentials ):
280
+ with pytest .raises (ValueError , match = "Project ID could not be identified.*" ):
281
+ ibis .bigquery .connect (credentials = credentials )
You can’t perform that action at this time.
0 commit comments