-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Replace deprecated smart_open.smart_open function with a thin wrapper #544
Conversation
Scary. Any harm keeping This will break a lot of code… including our own in |
Yeah, the harm is that they're not strictly compatible - the former passes parameters as *args, the latter wraps them in a dict.
We could either pin the version, or stop using the deprecated function. It's been deprecated for years now. |
Yeah, we'll have to re-release the datasets. They're meant to be immutable, so can't (=shouldn't) edit. |
Less than a year (Nov 2019). The smart_open README looks broken / unfinished; can you have a look?
|
Let's take a moment to truly appreciate this prophetically ironic sentence... |
Or maybe another moment to wonder just how smart smart_open is? Glad I’ve learned to watch repos I use in production code! |
If we're gonna open up that can of worms, then it may be worth thinking about how we handle
While most of the above is for us to work out as part of the gensim effort (e.g. piskvorky/gensim#2283), the relevance to smart_open is as follows:
@piskvorky WDYT about the above points? How shall we move forward, both with this PR and in general? |
One way to still-soften the removal would be to leave a stub that errors with a message pointing to help (or if possible, the exact recommended line-of-code with which to replace old usages). Compared to just a For |
Gensim-data is low priority for me right now (and has been for a long time). I'd probably design it differently (and not call it This came to my attention only because I saw deprecations coming from a dataset that relies on
Fix README + keep |
'for more information.' % sorted(kwargs) | ||
) | ||
del kwargs | ||
return open(**locals()) |
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.
If the actual end goal is true deprecation/removal of the function itself - not just some sets of supported parameters – perhaps OK to fail in this case, too. (Or at least: show some deprecation warning before proceeding?) However, if it's true that in this case, the caller can just use smart_open.open()
with exactly the same params instead, the message could assure them that.
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.
We can't fail in this case because the gensim-data stuff will break.
I agree with the other suggestion.
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.
Clever solution! I like it.
How about the incomplete README
?
We're about to do a major version bump, so it's a good chance to drop deprecated functionality.