Skip to content

Conversation

loicdiridollou
Copy link
Member

@cmp0xff
Copy link
Contributor

cmp0xff commented Sep 30, 2025

Thank you for the proposal, it looks good to me.

  • In tests/series/test_series.py, there are two commented-out lines containing pd.Series[Categorical] (L2917) and pd.Series[category] (L2480), respectively. Could you try to uncomment them and make them work?
  • Series[category] is something that does not really exist in the stubs before. @Dr-Irv could you confirm the idea?

@loicdiridollou
Copy link
Member Author

I tried uncommenting the lines and it is raising many errors, I have not thing examples of Series[category] in the code yet.

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 30, 2025

Thank you for the proposal, it looks good to me.

  • In tests/series/test_series.py, there are two commented-out lines containing pd.Series[Categorical] (L2917) and pd.Series[category] (L2480), respectively. Could you try to uncomment them and make them work?
  • Series[category] is something that does not really exist in the stubs before. @Dr-Irv could you confirm the idea?

I think those have been commented out since they were first created. I think they can be uncommented, but they should be using Series[pd.CategoricalDtype] not Series[category] or Series[Categorical]

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

  • Could you merge main into your branch? Resolving conflicts should be easy.
  • If you haven't, could you try the idea in #1391 (comment), namely changing to Series[CategoricalDtype]?
  • Otherwise it looks good to me, now that the idea of having Series[CategoricalDtype] has also been approved.

@loicdiridollou
Copy link
Member Author

s.astype("dictionary[pyarrow]") is Unknown, not sure if we have the correct overload for it.
Also when I try to do it at run time I get a TypeError so wondering what is the goal of having that only for type checking and not run time. Open to suggestions

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

s.astype("dictionary[pyarrow]") is Unknown, not sure if we have the correct overload for it. Also when I try to do it at run time I get a TypeError so wondering what is the goal of having that only for type checking and not run time. Open to suggestions

I see, those commented-out tests do not make sense to me, either.

One small thing, otherwise good to go.


def test_array_property() -> None:
"""Test that Series.array returns ExtensionArray and its subclasses"""
# casting due to pandas-dev/pandas-stubs#1383
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove thie comment

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 30, 2025

I see, those commented-out tests do not make sense to me, either.

If they don't work at runtime, then let's just delete them and not worry about it.

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

It looks good to me now, but you have not yet requested me to review again. Would you agree to merge @loicdiridollou ?

@loicdiridollou
Copy link
Member Author

Yes good to merge (I often forgot to rerequest sorry)

@cmp0xff cmp0xff merged commit a9f0bd3 into pandas-dev:main Sep 30, 2025
13 checks passed
@cmp0xff
Copy link
Contributor

cmp0xff commented Sep 30, 2025

Thank you @loicdiridollou! I am getting familiar with the workflow, hopefully I'll be able to do the review better in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index([1], dtype="category") and Series([1], dtype="category") are mistyped
3 participants