Use default google cloud project if not supplied? #2828
Comments
|
Thanks for the detailed proposal, @max-sixty. I think it makes sense to fall back to the default project configured by the gcloud user / service account if it's not specified in This isn't a change we would prioritize, and I'm glad to see you have a workaround in the meantime. I imagine it could be quite straightforward. I'll mark this a good first issue, for whenever you (or another community member) has the time. |
|
I'm happy to have a look into this — any ideas on where to start? I'm not familiar with the code base.
|
|
You're looking in the right place: Here is where dbt parses the dbt/plugins/bigquery/dbt/adapters/bigquery/connections.py Lines 90 to 92 in e945bca And here is where dbt uses that In between those two is the code you linked to. I think it'd be a fairly straightforward change to add some logic that checks if database is none, and sets it to the user's default |
max-sixty
mentioned this issue

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Describe the feature
Currently using BigQuery requires defining your project in
profiles.yml: https://docs.getdbt.com/reference/warehouse-profiles/bigquery-profile/Google Cloud APIs generally fall back to the default project when one isn't specified. This is helpful for code that runs in multiple project environments — it'll reference the datasets in whatever project it's running in.
So the feature would be to align
dbtwith that standard, and allow for:Describe alternatives you've considered
Currently we have something like:
...and set
$PROJECTto the result ofgcloud config get-value project. This is OK, but some cruft.(and if I'm missing something and there's any easy solution to this, that would be gratefully received!)
Who will this benefit?
BigQuery users, particularly those running across dev and prod environments
Are you interested in contributing this feature?
Not right now, given my other OSS work, but would be keen to contribute to dbt at some point!
Thank you!
The text was updated successfully, but these errors were encountered: