a better error description when GCP project is not set (#11377)

- **Description:** a little bit better error description
  - **Issue:** #10879
pull/11385/head
Leonid Kuligin 1 year ago committed by GitHub
parent 0d80226c64
commit 4f4e0f38fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -58,6 +58,14 @@ class BigQueryLoader(BaseLoader):
) from ex
bq_client = bigquery.Client(credentials=self.credentials, project=self.project)
if not bq_client.project:
error_desc = (
"GCP project for Big Query is not set! Either provide a "
"`project` argument during BigQueryLoader instantiation, "
"or set a default project with `gcloud config set project` "
"command."
)
raise ValueError(error_desc)
query_result = bq_client.query(self.query).result()
docs: List[Document] = []

Loading…
Cancel
Save