databricks-sql-python icon indicating copy to clipboard operation
databricks-sql-python copied to clipboard

Add real return code on `UnsafeToRetryError`

Open Uranium2 opened this issue 9 months ago • 1 comments

We are having random errors while fetching data with the connector to our databricks (serverless warehouse). We tried to debug the origin of this fail, but we were not able to find the source of the issue.

Is it possible to add more information on the return code when we can not perform a retry while making a statement with the cursor?

source code

            raise UnsafeToRetryError(
                "ExecuteStatement command can only be retried for codes 429 and 503"
            )

Could we add the real return code to this? So we can investigate better on our side. Something like this:

            raise UnsafeToRetryError(
                f"ExecuteStatement command can only be retried for codes 429 and 503. Got {status_code}"
            )

Using databricks-sql-python==4.0.0

Uranium2 avatar Feb 18 '25 17:02 Uranium2

Hi @Uranium2 , thanks for the suggestion. Added a PR to address this.

samikshya-db avatar Feb 24 '25 19:02 samikshya-db