astronomer-providers icon indicating copy to clipboard operation
astronomer-providers copied to clipboard

Databricks raise exception instead of return in case of user error

Open pankajastro opened this issue 2 years ago • 1 comments

currently, _do_api_call_async of databricks does not raise an exception in case of user error instead it returns a Dict because of this the caller of this method might not be aware that the API call was successful or not and the code execution will break in an unexpected way. in this PR I'm modifying this to raise an exception instead of returning Dict. https://github.com/astronomer/astronomer-providers/blob/main/astronomer/providers/databricks/hooks/databricks.py#L53

pankajastro avatar Aug 30 '22 20:08 pankajastro

Codecov Report

Merging #612 (89932aa) into main (514a814) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #612   +/-   ##
=======================================
  Coverage   98.23%   98.24%           
=======================================
  Files          72       72           
  Lines        3975     3978    +3     
=======================================
+ Hits         3905     3908    +3     
  Misses         70       70           
Impacted Files Coverage Δ
...stronomer/providers/databricks/hooks/databricks.py 95.31% <100.00%> (ø)
...onomer/providers/databricks/triggers/databricks.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 30 '22 21:08 codecov[bot]