Skip to content

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Aug 22, 2025

__reduce__ isn't documented / part of the public API, but SingleConstructorOffset is used to group together some kinds of offsets, and type checkers can detect some erroneous usage, e.g.

if TYPE_CHECKING_INVALID_USAGE:
pd.PeriodDtype(
freq=CustomBusinessDay() # type:ignore[arg-type] # pyright: ignore[reportArgumentType]
)
pd.PeriodDtype(
freq=BusinessDay() # type:ignore[arg-type] # pyright: ignore[reportArgumentType]
)

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

@MarcoGorelli MarcoGorelli force-pushed the remove-singleconstructor-offset branch from 9265aa7 to c2a41eb Compare August 22, 2025 12:43
@MarcoGorelli MarcoGorelli changed the title remove SingleConstructorOffset remove SingleConstructorOffset.__reduce__ Aug 22, 2025
@MarcoGorelli MarcoGorelli marked this pull request as ready for review August 22, 2025 12:56
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

thanks @MarcoGorelli

@Dr-Irv Dr-Irv merged commit f7c66da into pandas-dev:main Aug 22, 2025
13 checks passed
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.

2 participants