rdblue commented on code in PR #5897:
URL: https://github.com/apache/iceberg/pull/5897#discussion_r989541079
##########
python/tests/catalog/test_rest.py:
##########
@@ -113,6 +114,20 @@ def test_token_401(rest_mock: Mocker):
assert message in str(e.value)
+def test_token_401_oauth_error(rest_mock: Mocker):
+ """This test returns a OAuth error instead of an OpenAPI error"""
+ message = """RESTError 401: Received unexpected JSON Payload: {"error":
"invalid_client", "error_description": "Invalid credentials"}, errors: <bound
method ValidationError.errors of ValidationError(model='ErrorResponse',
errors=[{'loc': ('error',), 'msg': 'value is not a valid dict', 'type':
'type_error.dict'}])>"""
Review Comment:
It looks like you need to call `e.errors()` to avoid this in the message:
`errors: <bound method ValidationError.errors of ValidationError(...)>`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]