Skip to content

Read hdf does not close store #25863

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

Merged
merged 9 commits into from
Mar 31, 2019

Conversation

rbenes
Copy link
Contributor

@rbenes rbenes commented Mar 24, 2019

df = pd.DataFrame({'a': range(2), 'b': range(2)})
df.to_hdf(path, 'k1')

pytest.raises(KeyError, pd.read_hdf, path, 'k2')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not an accepted format any longer, use the context manager

with pytest.raises(....):
    ...

Copy link
Contributor Author

@rbenes rbenes Mar 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated 244cab4 . But with form pytest.raises(KeyError, ...) I followed the codestyle in this test file. But now I see some STY issues, that are trying to unify to context manager style 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep this happens to be the last file - i think it’s fixed in another PR

@jreback jreback added Bug IO HDF5 read_hdf, HDFStore labels Mar 24, 2019
@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #25863 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #25863   +/-   ##
=======================================
  Coverage   91.47%   91.47%           
=======================================
  Files         173      173           
  Lines       52872    52872           
=======================================
  Hits        48364    48364           
  Misses       4508     4508
Flag Coverage Δ
#multiple 90.03% <0%> (ø) ⬆️
#single 41.82% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/pytables.py 90.19% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72f4098...ded7dd0. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #25863 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25863      +/-   ##
==========================================
- Coverage   91.81%    91.8%   -0.01%     
==========================================
  Files         175      175              
  Lines       52578    52578              
==========================================
- Hits        48273    48269       -4     
- Misses       4305     4309       +4
Flag Coverage Δ
#multiple 90.36% <0%> (ø) ⬆️
#single 41.9% <100%> (-0.08%) ⬇️
Impacted Files Coverage Δ
pandas/io/pytables.py 90.23% <100%> (ø) ⬆️
pandas/io/gbq.py 75% <0%> (-12.5%) ⬇️
pandas/core/frame.py 96.79% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0ba498...de087c4. Read the comment docs.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion to improve whatsnew but otherwise lgtm

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm @jreback

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trivial doc-update. ping on green.

@jreback jreback added this to the 0.25.0 milestone Mar 30, 2019
@WillAyd WillAyd merged commit e01bcc3 into pandas-dev:master Mar 31, 2019
@WillAyd
Copy link
Member

WillAyd commented Mar 31, 2019

Thanks @rbenes !

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

Successfully merging this pull request may close these issues.

read_hdf does not close store when raise KeyError
4 participants