Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

read_hdf does not work with auto_close argument #9327

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

Closed
wikiped opened this issue Jan 21, 2015 · 3 comments
Closed

read_hdf does not work with auto_close argument #9327

wikiped opened this issue Jan 21, 2015 · 3 comments
Labels
IO HDF5 read_hdf, HDFStore Usage Question

Comments

@wikiped
Copy link

wikiped commented Jan 21, 2015

When trying to create DataFrame from HDF Store with auto_close=True or False it breaks with error:

somedf = pd.DataFrame({'a':[1,2], 'b':[3,4]})
somedf.to_hdf('hdf_file', 'somekey', format='t', mode='w')
newdf = pd.read_hdf('hdf_file', 'somekey', auto_close=True)
newdf

error:

d:\Anaconda\envs\py2k\lib\site-packages\pandas\io\pytables.pyc in <lambda>(store, auto_close)
    303 
    304     f = lambda store, auto_close: store.select(
--> 305         key, auto_close=auto_close, **kwargs)
    306 
    307     if isinstance(path_or_buf, string_types):

TypeError: select() got multiple values for keyword argument 'auto_close'

The same without auto_close argument works fine:

newdf = pd.read_hdf('hdf_file', 'somekey')
newdf

yielding:

   a  b
0  1  3
1  2  4

pandas 0.15.2, pytables 3.1.1 on Win8.1x64

@jreback
Copy link
Contributor

jreback commented Jan 21, 2015

you don't need to pass this argument to read_hdf, by definition these are opened/closed correctly.

@jreback jreback closed this as completed Jan 21, 2015
@jreback jreback added IO HDF5 read_hdf, HDFStore Usage Question labels Jan 21, 2015
@TomAugspurger
Copy link
Contributor

Should probably remove that from the docstring then. Is there ever a case where auto_closing isn't desired? Performance-sensitive tasks maybe?

@jreback
Copy link
Contributor

jreback commented Jan 21, 2015

this is an internal argument for all intents (so maybe change to _auto_close). Because it needs to be called in context.

bashtage pushed a commit to bashtage/pandas that referenced this issue Jun 11, 2015
Remove docstring indicating auto_close can be used in read_hdf.
This value is always ignored.
Also correctly implements support for passing open HDFStores.
Adds error handling for unknown buffer-types.

xref pandas-dev#9327
jreback pushed a commit that referenced this issue Jun 12, 2015
Remove docstring indicating auto_close can be used in read_hdf.
This value is always ignored.
Also correctly implements support for passing open HDFStores.
Adds error handling for unknown buffer-types.

xref #9327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HDF5 read_hdf, HDFStore Usage Question
Projects
None yet
Development

No branches or pull requests

3 participants