AAfghahi commented on a change in pull request #15151:
URL: https://github.com/apache/superset/pull/15151#discussion_r652353048
##########
File path: tests/databases/api_tests.py
##########
@@ -1668,38 +1675,74 @@ def
test_validate_parameters_invalid_payload_schema(self):
response = json.loads(rv.data.decode("utf-8"))
assert rv.status_code == 422
- assert response == {
- "errors": [
- {
- "message": "Missing data for required field.",
- "error_type": "INVALID_PAYLOAD_SCHEMA_ERROR",
- "level": "error",
- "extra": {
- "invalid": ["engine"],
- "issue_codes": [
- {
- "code": 1020,
- "message": "Issue 1020 - The submitted payload
has the incorrect schema.",
- }
- ],
+ invalid_schema = response["errors"][0]["extra"]["invalid"][0]
+ # This is done because this array of errors does not have a
deterministic order
+ if invalid_schema == "engine":
Review comment:
@betodealmeida and @hughhhh I was unable to find a way of sorting this
array of objects, despite reading about it. Part of the issue is that the only
thing that is different between two objects is an array inside of an object. I
hate this methodology though. How do I make it better?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]