-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] in mlflow
plugin, improve informativity of ModuleNotFoundError
messages
#5487
[ENH] in mlflow
plugin, improve informativity of ModuleNotFoundError
messages
#5487
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.
Thx, good idea!
Although to minimize coupling, I would not change the _check_soft_dependencies
utility, but instead use the obj
argument to override the error message in the downstream case.
Sorry, could you explain what you mean by "but instead use the obj argument to override the error message in the downstream case"? As far as I understand, we need to throw this error whenever a mlflow-related functionality is invoked. All these functionalities should have a Adding the message at the origin of the error seems like the most obvious way to go about it but I may have misunderstood your point. |
Sorry, I meant using the Personally, I don't think adding the message at the very origin of the error is the best way to go here, as it introduces coupling between the calling location and the called logic. As the called method already has an argument that allows you to specify the error message, we should imo simply use that. |
Wouldn't that increase the amount of duplication for every An additional concern is where new developers are adding this line in their piece of code, they would also need to write the same error message or we'd get the original message again. |
Yes, you are right, it is not DRY. Then, the solution which is both DRY and not coupled would be an |
Great idea! |
_check_soft_dependencies()
to include more precise installation method for mlflow
mlflow
to contain a more precise information on ModuleNotFoundError
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.
Thanks!
Could you kindly add a full docstring for _check_mlflow_dependencies
, as developers will likely encounter this at the top of their question stack when reading the mlflow
plugin.
Non-blocking: in test skipif
-s, I would still use _check_soft_dependencies
, as it is easier to parse (name and similar to the same pattern elsewhere), and the error message does not matter due to severity="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.
I'd be happy with this now, thanks.
mlflow
to contain a more precise information on ModuleNotFoundError
mlflow
plugin, improve informativity of ModuleNotFoundError
messages
Reference Issues/PRs
Fixes #5417
What does this implement/fix? Explain your changes.
I believe the original
ModuleNotFoundError
message was not accurate formlflow
since the error it gave made it seem likemlflow
can be installed in the soft-dependencies bundle. I've added a more accurate message that points the user to usepip install sktime[mlflow]
.Does your contribution introduce a new dependency? If yes, which one?
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
Any other comments?
PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
sktime
root directory (not theCONTRIBUTORS.md
). Common badges:code
- fixing a bug, or adding code logic.doc
- writing or improving documentation or docstrings.bug
- reporting or diagnosing a bug (get this pluscode
if you also fixed the bug in the PR).maintenance
- CI, test framework, release.See here for full badge reference
See here for further details on the algorithm maintainer role.
For new estimators
docs/source/api_reference/taskname.rst
, follow the pattern.Examples
section.python_dependencies
tag and ensureddependency isolation, see the estimator dependencies guide.