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
[AIRFLOW-2608] Implements/Standardize custom exceptions for experimental APIs #3496
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3496 +/- ##
==========================================
+ Coverage 77.4% 77.42% +0.02%
==========================================
Files 204 204
Lines 15185 15195 +10
==========================================
+ Hits 11754 11765 +11
+ Misses 3431 3430 -1
Continue to review full report at Codecov.
|
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.
This looks good to me, one minor nit here. Bit hesitant with the Exceptions, if we have to create an exception for every possible resource, this can grow quite big. Airflow{Dag,DagRun,Pool}NotFound
etc.
status_code = 400 | ||
|
||
|
||
class AirflowNotFoundException(AirflowException): |
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.
Maybe add a docstring here
8833433
to
028d74a
Compare
That's true, however, I've already added the NotFound exceptions for each of the resources in this PR, and this would help us standardize and differentiate the exceptions based on the objects. |
5217b2b
to
10eb0fb
Compare
10eb0fb
to
c467b07
Compare
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.
Thanks @verdan for cleaning this up! Cheers
…tal APIs Implements/Standardize custom exceptions for experimental APIs Implements/Standardize custom exceptions for experimental APIs Closes apache#3496 from verdan/AIRFLOW-2608-api- exceptions-handling
Make sure you have checked all steps below.
JIRA
Description
This PR adds custom exceptions for the APIs, so that we can handle different kind of exceptions efficiently. We can also use these custom exceptions to add the default static message for each exceptions instead of adding that repeatedly in the code. This also helps standardize the status code of each exception.
Tests
Commits
Documentation
Code Quality
git diff upstream/master -u -- "*.py" | flake8 --diff