Fix problem in to_pandas() introduced in pandas 1.3.0#11921
Fix problem in to_pandas() introduced in pandas 1.3.0#11921taldcroft merged 1 commit intoastropy:mainfrom
Conversation
mhvk
left a comment
There was a problem hiding this comment.
This change looks good!
Out of scope here perhaps, but if pandas has the concept of names, should all names be set?
Also, might it be that the change in pandas is inadvertent? Perhaps still worth reporting, even with the proviso that perhaps it was happenstance and we're fine with being explicit?
I'm not a pandas expert, but my guess was that the index column is special and having a name is treated differently for the index. Well, I just tried something and I don't understand pandas names, but I am not sure I want to get into it... I'll open a pandas issue to report the astropy regression. |
|
(turns out this didn't backport to 4.3.x correctly so I'm doing it manually in 4e58cf4) |
Fix problem in to_pandas() introduced in pandas 1.3.0
Fix problem in to_pandas() introduced in pandas 1.3.0
|
I had to backport this to LTS to fix failures there so updating the milestone |
Description
Fix an issue in
Table.to_pandas(index=<colname>)where the index column name was not being set properly for theDataFrameindex. This was introduced by an API change in pandas version 1.3.0. Previously when creating aDataFramewith the index set to an astropyColumn, theDataFrameindex name was automatically set to the column name.Fixes #11918
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.