-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
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 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 @jtcohen6 I have a question about the new way to create a credentials with the
If I am correct, there is no way to set scopes to a google cloud "account" directly. In addition, there is no way to |
There are two approaches to set scopes to the
my-bigquery-db:
target: dev
outputs:
dev:
type: bigquery
method: oauth
project: [GCP project id]
dataset: [the name of your dbt dataset] # You can also use "schema" here
threads: [1 or more]
timeout_seconds: 300
location: US # Optional, one of US or EU
priority: interactive
retries: 1
scopes:
- https://www.googleapis.com/auth/bigquery
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/drive |
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
dbt
with that standard, and allow for:Describe alternatives you've considered
Currently we have something like:
...and set
$PROJECT
to 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: