-
Notifications
You must be signed in to change notification settings - Fork 161
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
[Bug] BQ quota_project defaults to the account/user's environment default #1347
Comments
@jcarpenter12 amazing and thorough write up! What I still need help on is:
|
Thanks for getting back to me so quickly @dataders. As for 1. I have updated the expected behaviour section with what I believe should be happening according to the docs. As for 2. you're right it's not very clear. In my example to prove that it is picking up the quota project from the environment I created a new project that If i had set a project in my gcloud using Please let me know if these aren't suitable and I'll come up with another way to demonstrate the issue as I see it. |
Updated the title and contents of the issue. I have been speaking to the maintainers on their slack channel about this and we have managed to narrow down the issue, and the original issue was somewhat misleading |
@jcarpenter12 can we close as duplicate of #1343 or will additional work be required for this? |
Hi @colin-rogers-dbt no problem with any of that my side. Raised it originally for what I thought was the bug and then a feature for a potential fix. But largely the feature details it the same way anyway and the bug does just clutter things a bit |
Is this a new bug in dbt-bigquery?
Current Behavior
When a user or service account's default
quota_project_id
is set to a project other than theexecution_project
specified in theprofiles.yml
DBT will use this as thequota_project_id
in the underlying request opposed to anything set in theprofiles.yml
. This is a side effect and will mean that a DBT will fail to connect to BigQuery if the user does not have BigQuery API enabled in the project their credentials default to. It will also mean that certain quota limits are being used up in the default project.You can see the default quota project_id from the contents of your
application_default_credentials
file. It should look something like this. A similar structure applies to the contents of service account keys I believeThis issue arose when running a CI/CD pipeline that is defined in a project separate to either the
project
orexecution_project
and did not have the BQ API enabled, so it failed to connect.Expected Behavior
What I think should be happening according to the docs
As this is a side effect the expected behaviour is a bit difficult to define but DBT should either set
execution_project
as thequota_project_id
in the BQ client or allow the user to override it themselves in theprofiles.yml
.In my opinion the user should be able to specify a separate optional
quota_project
to use separate fromproject
andexecution project
. By not setting it, it will default to what it does now and not change the behaviour. Feature Request here #1343Steps To Reproduce
foo
gcloud config set project $MY_QUOTA_PROJECT
(replace with the name of step 1)gcloud auth application-default login
cat ~/.config/gcloud/application_default_credentials
. It should look something like the followingpip install dbt-core==1.8.6 dbt-bigquery==1.8.2
profiles-dir
to wherever your profile is locateddbt debug --connection --profiles-dir .
You should then see a log output like the below. Here you can see the quota project is causing this connection to fail even though it is not specified anywhere in the dbt profile itself and is instead being picked up from the environment.
Relevant log output
Environment
Additional Context
This relates to #1343 a feature request to add quota_project and a potential PR for it here #1345
Docs PR : dbt-labs/docs.getdbt.com#6054
As noted on the #1343 I have not raised a change to a dbt adapter before so please do let me know if I am misunderstanding anything
The text was updated successfully, but these errors were encountered: