Closed xoen closed 6 years ago
Merging #47 into master will increase coverage by
1.5%
. The diff coverage is33.33%
.
@@ Coverage Diff @@
## master #47 +/- ##
=========================================
+ Coverage 72.55% 74.06% +1.5%
=========================================
Files 4 4
Lines 809 798 -11
=========================================
+ Hits 587 591 +4
+ Misses 222 207 -15
Impacted Files | Coverage Δ | |
---|---|---|
etl_manager/etl.py | 58.01% <33.33%> (+4.65%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 7ce7cdd...7d9d8f7. Read the comment docs.
Let's double check with out Python ninja @r4vi if this makes sense to him :)
fixes #45
Exceptions are a value source of information that can be used to debug problems. By silencing them, the end user (the writer of the Glue Job) will not be able to understand if something went wrong or the job succeeded and will not know what was the cause of the problem: Was it a connectivity issue? was it a credentials problems? was it a quota problem? who knows, it's hard to tell without a stacktrace.
I've added two exception classes:
JobMisconfigured
for when the user didn't set thejob_name
JobNotStarted
for when the user tried to get the status of the job but the job doesn't have arun_id
(possibly because the user didn't start the job yetThis is just a starting point, we may want to handle some exceptions and add more exceptions classes but it's a good start I think.
Also, I've removed some of the
instanceof
checks as type checking is often an antipattern. In this specific case we were expecting a dictionary but if that's not the case it means something went wrong before, so there should be an exception (unless we know how to handle it properly, andpass
is just silencing a problem).NOTE: This may potentially break the client code.