Share exceptions when opening AppendRowsStream instead of the generic "Try turning on DEBUG level logs to see the error." exception
- When an exception occurs opening a AppendRowsStream (for example when there is a protobuf-bq schema mismatch), a generic ` "There was a problem opening the stream. Try turning on DEBUG level logs to see the error." exception is raised which is incredibly unhelpful.
- Our production services do not run with debug logs and I recently spent a lot of time trying to reproduce the conditions which would trigger a stream open error which would have been MUCH simpler if the exception was simply forwarded through.
- There is the following TODO in the code here
# Something went wrong when opening the RPC.
if not is_consumer_active:
# TODO: Share the exception from _rpc.open(). Blocked by
# https://github.com/googleapis/python-api-core/issues/268
request_exception = exceptions.Unknown(
"There was a problem opening the stream. "
"Try turning on DEBUG level logs to see the error."
)
self.close(reason=request_exception)
raise request_exception
It appears https://github.com/googleapis/python-api-core/issues/268 has been closed. It would be really awesome if this could be revisited.
Hi @dhendry, thank you for raising this issue! Actionable error is something we want to ensure for our users. Just so I know the exact situation, could you share a code snippet that reproduces the issue, and even better, the exact unhelpful exception raised (the printed stack tracing and stuff)? Thank you for your help :)
@Linchin I am working on something related to this. I can provide you with code and a demo during our next 1:1.
This issue was transferred from python-bigquery-storage to google-cloud-python as part of the work for https://github.com/googleapis/google-cloud-python/issues/10991.