Skip to content
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

Expanded import_or_raise to catch all exceptions #759

Merged
merged 4 commits into from May 15, 2020

Conversation

christopherbunn
Copy link
Contributor

Resolves #729

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #759 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #759   +/-   ##
=======================================
  Coverage   99.38%   99.38%           
=======================================
  Files         151      151           
  Lines        5532     5545   +13     
=======================================
+ Hits         5498     5511   +13     
  Misses         34       34           
Impacted Files Coverage Δ
evalml/tests/utils_tests/test_gen_utils.py 100.00% <100.00%> (ø)
evalml/utils/gen_utils.py 100.00% <100.00%> (ø)

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 6d6af3b...df6587a. Read the comment docs.

Copy link
Contributor

@angela97lin angela97lin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just left a small suggestion to use mocking + a minor typo, but 👍

evalml/tests/utils_tests/test_gen_utils.py Outdated Show resolved Hide resolved
@@ -20,6 +20,9 @@ def import_or_raise(library, error_msg=None):
error_msg = ""
msg = (f"Missing optional dependency '{library}'. Please use pip to install {library}. {error_msg}")
raise ImportError(msg)
except Exception as ex:
msg = (f"An exception occured while trying to import `{library}`: {str(ex)}")
raise Exception(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This will be a great place to add some logging once @angela97lin's work adds it!

Copy link
Contributor

@angela97lin angela97lin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM 👍

@christopherbunn christopherbunn merged commit 4c0a24f into master May 15, 2020
@dsherry dsherry deleted the 729_add_ex_to_raise_or_import branch October 29, 2020 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update import_or_raise to catch all exceptions
3 participants