BUG: HDF5 pandas_version attr now reflects actual pandas version (GH-62792)#65606
Open
jbrockmendel wants to merge 2 commits into
Open
BUG: HDF5 pandas_version attr now reflects actual pandas version (GH-62792)#65606jbrockmendel wants to merge 2 commits into
jbrockmendel wants to merge 2 commits into
Conversation
…62792) Previously `to_hdf` always wrote the hardcoded string "0.15.2" to the HDF5 `pandas_version` attribute, regardless of the installed pandas version. Write the actual `pd.__version__` instead, and make the reader's version parser tolerant of non-numeric trailing components (e.g. ".dev0+abc") so the existing `is_old_version` check still works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.Summary
Previously
to_hdfalways wrote the hardcoded string"0.15.2"to the HDF5pandas_versionattribute, regardless of the installed pandas version. The constant has been pinned since 2014 (GH-8793) and was effectively a stand-in for a storage-schema version, but the attribute name leads users to expect the actual pandas version — see GH-62792 and GH-19314.This PR writes
pd.__version__instead, and tightens the reader's version parser so the existingis_old_versioncheck (which only triggers below0.10.1) still works with version strings like"3.1.0.dev0+abc"or"2.3.3rc1".No whatsnew entry — single-attribute behavior tweak, intentionally omitted.