Skip to content

ERR: include original error message for missing required dependencies #26665

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

Merged
merged 2 commits into from
Jun 5, 2019
Merged

ERR: include original error message for missing required dependencies #26665

merged 2 commits into from
Jun 5, 2019

Conversation

DanielFEvans
Copy link
Contributor

Modifies the try-catch for imports of required dependencies (numpy, pytz, and dateutil) to record any exceptions raised, and then to include the message from these when reporting that required dependencies are missing.

Previously, the error message simply claimed the dependency was missing, which was somewhat misleading if the dependency was installed but raised its own ImportError (missing sub-dependencies, bad install, etc.).

@datapythonista datapythonista added the Error Reporting Incorrect or improved errors from pandas label Jun 5, 2019
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @DanielFEvans

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@jorisvandenbossche jorisvandenbossche changed the title #23868: Modify error message for missing dependencies to report original ERR: include original error message for missing required dependencies Jun 5, 2019
@jorisvandenbossche jorisvandenbossche merged commit 047d32d into pandas-dev:master Jun 5, 2019
@jorisvandenbossche jorisvandenbossche added this to the 0.25.0 milestone Jun 5, 2019
@jorisvandenbossche
Copy link
Member

Sorry all, not sure how I missed this was actually not passing CI.

@jorisvandenbossche
Copy link
Member

@DanielFEvans sorry, I was a bit fast with merging this (for some reason I overlooked that the CI was red). So for now I reverted the change on master, to avoid that all other PRs will fail.

Can you open a new PR with the same changes, but then look into fixing the tests? (I didn't fully find out how to fix them, my attempt is in #26674)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shouldn't the try: __import__ in __init__ re-raise original exception?
3 participants