-
-
Couldn't load subscription status.
- Fork 19.2k
ENH: add contextmanager to HDFStore (#8791) #8958
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
Conversation
|
this is fine pls add a release note in the enhancements section |
|
@jreback I've updated the docs. Not sure if I've got it right. |
|
pls squash, otherwise looks ok.
|
|
@jreback I've added warning that get_store is deprecated |
doc/source/whatsnew/v0.15.2.txt
Outdated
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.
take out the get_store still works..
|
On the deprecation, I don't know if it is needed to really deprecate it, maybe we could only do "deprecation by documentation" (-> keeping it as an alias (and indicate this in the docstring of |
|
@jorisvandenbossche @jreback so I've made those changes. Sorry misunderstood that you guys wanted it deprecated. |
|
ok, pls add a release note (put in enhancements section) |
pandas/io/pytables.py
Outdated
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 think we should add here something to the docstring of get_store that is is an alias of HDFStore -> better to use that.
You can use pd.util.decorators.Appender for that. Something like:
get_store = Appender("Backwards compatible alias for ``HDFStore``", join='\n')(HDFStore)
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've added that now.
instead of having to use
with get_store('file.h5') as store:
store.keys()
now we can do
with HDFStore('file.h5') as store:
store.keys()
|
looks ok to me. ping on green. |
|
@jreback it's green |
|
@vikram thanks! |
Added a context manager to HDFStore
closes #8791