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

- **Description:** a little bit better error description
  - **Issue:** #10879
This commit is contained in:
Leonid Kuligin
2023-10-04 17:57:47 +02:00
committed by GitHub
parent 0d80226c64
commit 4f4e0f38fc

View File

@@ -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] = []