Skip to main content

Posts

Showing posts from November, 2020

GCP: google.api_core.exceptions.BadRequest: 400 POST , when running a bigquery in your shell

I like to code directly in the GCP console editor to test some POCs, but with this approach you have to deal with some situations, such as, getting your shell and editor disconnected after a few minutes idle, then when you retake your coding and re running your python code to execute some bigquery statements, you can see a nasty error like this: google.api_core.exceptions.BadRequest: 400 POST https://bigquery.googleapis.com/bigquery/v2/projects//jobs: Invalid project ID ''. Project IDs must contain 6-63 lowercase letters, digits, or dashes. Some project I Ds also include domain name separated by a colon. IDs must start with a letter and may not end with a dash. what happened?, you gcp shell was reseted and you lost your project connection, you can check that: (venv) jcalfucura@cloudshell: ~/crossprod $ gcloud config list --format 'value(core.project)' 2>/dev/null returns nothing. You can also use this statement: (venv) jcalfucura@cloudshell: ~/crossprod $ gcloud con