Skip to content

ENH: Add support to import optional submodule and specify different min_version than default #38925

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
Jan 4, 2021

Conversation

lithomas1
Copy link
Member

cc @jreback, @arw2019

Copy link
Member

@arw2019 arw2019 left a comment

Choose a reason for hiding this comment

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

LGTM

I think no whatsnew needed since no user-facing implications

@jreback jreback added the Build Library building on various platforms label Jan 3, 2021
@jreback jreback added this to the 1.3 milestone Jan 3, 2021
@@ -58,7 +60,11 @@ def _get_version(module: types.ModuleType) -> str:


def import_optional_dependency(
Copy link
Contributor

Choose a reason for hiding this comment

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

i believe we could / should min_version in the codebase, but can be a followon

@@ -85,7 +90,9 @@ def import_optional_dependency(
* ignore: Return the module, even if the version is too old.
It's expected that users validate the version locally when
using ``on_version="ignore"`` (see. ``io/html.py``)

min_version : str, default None
Copy link
Contributor

Choose a reason for hiding this comment

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

can you create an issue (and PR!) to consolidate raise_on_missing / on_version which really should just be errors='raise|warn|ignore'

@arw2019 arw2019 mentioned this pull request Jan 3, 2021
5 tasks
@jreback jreback merged commit 9952626 into pandas-dev:master Jan 4, 2021
@jreback
Copy link
Contributor

jreback commented Jan 4, 2021

thanks @lithomas1

ok this is not actually running anywhere, can you use this wherever we actually use a min_version
also pls create an issue as described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: import_optional_dependency doesn't check version for submodules
3 participants