-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise 404 from Variable PATCH API if variable is not found #33885
Raise 404 from Variable PATCH API if variable is not found #33885
Conversation
Is it possible to add a test for that one? Should be easy following other tests in https://github.com/apache/airflow/tree/main/tests/api_connexion/endpoints. - and at the same time you will be able to see if removing your new code will trigger the error (thus giving ultimate certainty it's the solution) ? |
@potiuk, I added the test. And tried with removing the code, below is the result with test failing.
Also didn't wanted to leave the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally to confirm the issue and fix does resolve it.
* Raise variable not found if session returns empty * Added detail to the exception for json reponse * tests for patch api when variable doesn't exist * Dropped fstring * Unify varialbe not found message --------- Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> (cherry picked from commit 701c3b8)
Raise NotFound exception if variable search via session returns empty.
A possible fix for Issue.
closes: #33871