mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-13 08:27:03 +00:00
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:
parent
0d80226c64
commit
4f4e0f38fc
@ -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…
Reference in New Issue
Block a user