Skip to content

BUG: avoid DeprecationWarning when the Series has index as list of Series #55395

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 11 commits into from
Nov 16, 2023

Conversation

Charlie-XIAO
Copy link
Contributor

@Charlie-XIAO Charlie-XIAO commented Oct 4, 2023

@Charlie-XIAO Charlie-XIAO requested a review from WillAyd as a code owner October 4, 2023 08:27
@Charlie-XIAO Charlie-XIAO marked this pull request as draft October 4, 2023 11:58
@Charlie-XIAO Charlie-XIAO marked this pull request as ready for review October 4, 2023 14:35
@mroeschke mroeschke requested a review from rhshadrach October 4, 2023 16:45
@mroeschke mroeschke added the Warnings Warnings that appear or should be added to pandas label Oct 4, 2023
@Charlie-XIAO
Copy link
Contributor Author

@jbrockmendel I have adapted your suggestion of runtime importing ABCSeries and ABCIndex. However, is this also allowing MultiIndex which I think is not valid?

@jbrockmendel
Copy link
Member

However, is this also allowing MultiIndex which I think is not valid?

Then exclude ABCMultiIndex i guess

@jorisvandenbossche jorisvandenbossche added this to the 2.1.3 milestone Oct 27, 2023
@Charlie-XIAO
Copy link
Contributor Author

@jbrockmendel Sorry that I forgot about this PR. I have excluded ABCMultiIndex now.

@mroeschke
Copy link
Member

Looks pretty good. Could you resolve the merge conflict?

@Charlie-XIAO
Copy link
Contributor Author

Done @mroeschke

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM any other comments @jbrockmendel ?

@jorisvandenbossche jorisvandenbossche modified the milestones: 2.1.3, 2.1.4 Nov 13, 2023
@Charlie-XIAO
Copy link
Contributor Author

Done @mroeschke, sorry for the delay.

@mroeschke mroeschke merged commit 171cbcd into pandas-dev:main Nov 16, 2023
@mroeschke
Copy link
Member

Thanks @Charlie-XIAO

Copy link

lumberbot-app bot commented Nov 16, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.1.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 171cbcd3a6e79a5b845f39d2304d664bec10b9db
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #55395: BUG: avoid DeprecationWarning when the Series has index as list of Series'
  1. Push to a named branch:
git push YOURFORK 2.1.x:auto-backport-of-pr-55395-on-2.1.x
  1. Create a PR against branch 2.1.x, I would have named this PR:

"Backport PR #55395 on branch 2.1.x (BUG: avoid DeprecationWarning when the Series has index as list of Series)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@Charlie-XIAO Charlie-XIAO deleted the ser-mult-ind-ser branch November 16, 2023 18:37
mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Dec 4, 2023
…ries (pandas-dev#55395)

* BUG: avoid DeprecationWarning when the Series has index as list of Series

* hasattr(type(obj), '_data') not working as expected, for instance 'pytest pandas/tests/indexes/period/test_period.py::TestPeriodIndex::test_with_multi_index'

* adopt jbrockmendel suggestion: runtime import ABC{Index, Series}

* exclude ABCMultiIndex; move changelog to 2.1.3

* fix changelog order

* moved changelog 2.1.3 -> 2.1.4

(cherry picked from commit 171cbcd)
mroeschke added a commit that referenced this pull request Dec 4, 2023
…ries (#55395) (#56325)

* BUG: avoid DeprecationWarning when the Series has index as list of Series

* hasattr(type(obj), '_data') not working as expected, for instance 'pytest pandas/tests/indexes/period/test_period.py::TestPeriodIndex::test_with_multi_index'

* adopt jbrockmendel suggestion: runtime import ABC{Index, Series}

* exclude ABCMultiIndex; move changelog to 2.1.3

* fix changelog order

* moved changelog 2.1.3 -> 2.1.4

(cherry picked from commit 171cbcd)

Co-authored-by: Yao Xiao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Get deprecation warning from Series constructor
5 participants