Skip to content

Commit

Permalink
Force hdf key to have front slash
Browse files Browse the repository at this point in the history
Fixes dask#858
  • Loading branch information
mrocklin committed Dec 1, 2015
1 parent f59609a commit f0bd26a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions dask/dataframe/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def read_hdf(pattern, key, start=0, stop=None, columns=None,
>>> dd.read_hdf('myfile.1.hdf5', '/*') # doctest: +SKIP
"""
key = key if key.startswith('/') else '/' + key
paths = sorted(glob(pattern))
if (start != 0 or stop is not None) and len(paths) > 1:
raise NotImplementedError(read_hdf_error_msg)
Expand Down
2 changes: 1 addition & 1 deletion dask/dataframe/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def test_read_hdf():
with tmpfile('h5') as fn:
df.to_hdf(fn, '/data')
try:
dd.read_hdf(fn, '/data', chunksize=2)
dd.read_hdf(fn, 'data', chunksize=2)
assert False
except TypeError as e:
assert "format='table'" in str(e)
Expand Down

0 comments on commit f0bd26a

Please sign in to comment.