ground-truth-ai / amlaidatatests

Tests for input data into the Google AML AI API
Other
1 stars 0 forks source link

Running datatests fail when a quota project has been specified #24

Open ssabdb opened 1 month ago

ssabdb commented 1 month ago

It's been observed that when running with a quota project configured and minimum permissions, tests fail with:

image

This is despite the user having full permissions to query the table and project. The serviceusage.services.use permission is broad and should not be necessary to grant to a user.

This does not appear to a problem specific to amlaidatatests. Running from the same environment:

import google.cloud.bigquery as bq

a = bq.Client()
list(a.list_tables("<dataset>"))

Results in exactly the same exception, but running bq query 'select count(*) from <table>' is successful.

ssabdb commented 1 month ago

The problem seems to be that setting a quota project results in a verification against that project which requires serviceusage.services.use permission.

In cloud console the GOOGLE_CLOUD_QUOTA_PROJECT variable is automatically set, so running with this setting will break the datatests. It is possible to remove environment variable in the console by simply running:

unset GOOGLE_CLOUD_QUOTA_PROJECT

Unfortunately this has a side effect of issuing a large number of warnings when running the tests, e.g.

image

I'll leave this issue open until we've documented this in the docs. It should also be possible to work around this problem by adding a flag to suppress the associated user warnings.