diff --git a/.gitignore b/.gitignore index a1fe5bbd4..0d0b2e52b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ # Icon must end with two \r Icon +# IntelliJ Files +.idea # Thumbnails ._* diff --git a/src/databricks/sql/auth/retry.py b/src/databricks/sql/auth/retry.py index 0c6547cb4..ae006deab 100755 --- a/src/databricks/sql/auth/retry.py +++ b/src/databricks/sql/auth/retry.py @@ -327,8 +327,8 @@ def should_retry(self, method: str, status_code: int) -> Tuple[bool, str]: default, this means ExecuteStatement is only retried for codes 429 and 503. This limit prevents automatically retrying non-idempotent commands that could be destructive. - 5. The request received a 401 response, because this can never succeed. - 6. The request received a 403 response, because this can never succeed. + 5. The request received a 403 response, because this can never succeed. + 6. The request received a 401 response, because the User credentials are invalid Q: What about OSErrors and Redirects? @@ -342,6 +342,7 @@ def should_retry(self, method: str, status_code: int) -> Tuple[bool, str]: if status_code == 200: return False, "200 codes are not retried" + # Invalid Credentials error. Don't retry if status_code == 401: raise NonRecoverableNetworkError( "Received 401 - UNAUTHORIZED. Confirm your authentication credentials."