Skip to content

Commit

Permalink
Merge branch 'main' into support_Models
Browse files Browse the repository at this point in the history
  • Loading branch information
shichengzhou-db authored Sep 10, 2024
2 parents 87a6c56 + b34f502 commit c650ae4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Version changelog

## [Release] Release v0.32.1

### Bug Fixes

* Properly include message when handing SCIM errors ([#753](https://github.com/databricks/databricks-sdk-py/pull/753)).



## [Release] Release v0.32.0

### Bug Fixes
Expand Down
5 changes: 3 additions & 2 deletions databricks/sdk/errors/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ def parse_error(self, response: requests.Response, response_body: bytes) -> Opti
if detail:
# Handle SCIM error message details
# @see https://tools.ietf.org/html/rfc7644#section-3.7.3
error_args[
'message'] = f"{scim_type} {error_args.get('message', 'SCIM API Internal Error')}".strip(" ")
if detail == "null":
detail = "SCIM API Internal Error"
error_args['message'] = f"{scim_type} {detail}".strip(" ")
error_args['error_code'] = f"SCIM_{status}"
return error_args

Expand Down
2 changes: 1 addition & 1 deletion databricks/sdk/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.32.0'
__version__ = '0.32.1'
11 changes: 10 additions & 1 deletion tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@ def make_private_link_response() -> requests.Response:
'Please report this issue with the following debugging information to the SDK issue tracker at '
'https://github.com/databricks/databricks-sdk-go/issues. Request log:```GET /api/2.0/service\n'
'< 400 Bad Request\n'
'< this is not a real response```')), ])
'< this is not a real response```')),
[
fake_response(
'GET', 404,
json.dumps({
'detail': 'Group with id 1234 is not found',
'status': '404',
'schemas': ['urn:ietf:params:scim:api:messages:2.0:Error']
})), errors.NotFound, 'None Group with id 1234 is not found'
]])
def test_get_api_error(response, expected_error, expected_message):
with pytest.raises(errors.DatabricksError) as e:
raise errors.get_api_error(response)
Expand Down

0 comments on commit c650ae4

Please sign in to comment.