pierrejeambrun commented on code in PR #44322:
URL: https://github.com/apache/airflow/pull/44322#discussion_r1858123519
##########
tests/api_fastapi/core_api/routes/public/test_connections.py:
##########
@@ -235,9 +235,7 @@ def test_post_should_respond_already_exist(self,
test_client, body):
# Another request
response = test_client.post("/public/connections/", json=body)
assert response.status_code == 409
- assert response.json() == {
- "detail": f"Connection with connection_id: `{TEST_CONN_ID}`
already exists",
- }
+ assert response.json() == {"detail": "Unique constraint violation"}
Review Comment:
Maybe returning the `orig` is enough for now ? There is enough information
for the user to understand what's going on, but that's still a pretty technical
message for the user, so not ideal in the long term but that would allow us to
move forward.
And I would like to avoid going down the road of having to remove the global
exception handler and to that on a 'per' route basis with a lot of duplicated
code.
##########
tests/api_fastapi/core_api/routes/public/test_connections.py:
##########
@@ -235,9 +235,7 @@ def test_post_should_respond_already_exist(self,
test_client, body):
# Another request
response = test_client.post("/public/connections/", json=body)
assert response.status_code == 409
- assert response.json() == {
- "detail": f"Connection with connection_id: `{TEST_CONN_ID}`
already exists",
- }
+ assert response.json() == {"detail": "Unique constraint violation"}
Review Comment:
Other idea, create an issue and solve that in a successive PR. This one goal
is just to make things concitent accross the different endpoints.
##########
tests/api_fastapi/core_api/routes/public/test_connections.py:
##########
@@ -235,9 +235,7 @@ def test_post_should_respond_already_exist(self,
test_client, body):
# Another request
response = test_client.post("/public/connections/", json=body)
assert response.status_code == 409
- assert response.json() == {
- "detail": f"Connection with connection_id: `{TEST_CONN_ID}`
already exists",
- }
+ assert response.json() == {"detail": "Unique constraint violation"}
Review Comment:
Other idea, create an issue and solve that in a successive PR. This one goal
is just to make things concitent accross the different endpoints.
--
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]