Closed
Description
Environment details
- OS type and version: MacOS 11.6.2
- Python version: 3.9.9
- pip version: 20.3.4
pandas-gbq
version: 0.17.0
Steps to reproduce
- Create a service account that has the "BigQuery Data Editor" and "BigQuery JobUser" roles (these are not sufficient for using read_gbq; it's a user error to use them, but the focus of this ticket is that the helpful error message gets lost):
- Invoke pandas_gbq.read_gbq with params that should work - i.e. they'd work fine if the user had the "BigQuery User" role
You'll get this error:
> if isinstance(rpc_exc, grpc.Call) or _is_informative_grpc_error(rpc_exc):
E AttributeError: 'NoneType' object has no attribute 'Call'
The actual error is visible in the traceback:
E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E status = StatusCode.PERMISSION_DENIED
E details = "request failed: the user does not have 'bigquery.readsessions.create' permission for 'projects/redacted'"
The "NoneType has no attribute" message is misleading and obscures the problem. I believe the error should be reporting the permission issue that is captured in the above block.
Again, this is ultimately a user error due to the wrong permissions being used, but a user will find that out more quickly by getting back the actual error instead of the "NoneType has no attribute" error.