-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
ENH: Add support to import optional submodule and specify different min_version than default #38925
Conversation
There was a problem hiding this 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
@@ -58,7 +60,11 @@ def _get_version(module: types.ModuleType) -> str: | |||
|
|||
|
|||
def import_optional_dependency( |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'
thanks @lithomas1 ok this is not actually running anywhere, can you use this wherever we actually use a min_version |
…in_version than default (pandas-dev#38925)
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
cc @jreback, @arw2019