Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set Location for google-cloud-bigquery #269

Open
crbl1122 opened this issue May 20, 2024 · 0 comments
Open

How to set Location for google-cloud-bigquery #269

crbl1122 opened this issue May 20, 2024 · 0 comments

Comments

@crbl1122
Copy link

crbl1122 commented May 20, 2024

How can I set location in the BigQuery client?

The client is looking by default for the dataset in Region US while it is located in a different region.

use google_cloud_bigquery::client::{ClientConfig, Client};

#[tokio::main]
async fn main() {
    let (config, project_id) = ClientConfig::new_with_auth().await.unwrap();
    let client = Client::new(config).await.unwrap();
    run(&client, project_id.as_deref().unwrap_or_default()).await;

}

The error:

thread 'main' panicked at src/main.rs:17:67:
called `Result::unwrap()` on an `Err` value: JobHttp(Response(ErrorResponse { code: 404, errors: Some([ErrorResponseItem { message: "Not found: Dataset PROJECT_ID:DATASET_ID **was not found in location US**", reason: "notFound" }]), message: "Not found: Dataset PROJECT_ID:DATASET_ID was not found in location US" }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant