Skip to content

TYP Make IntervalDtype generic over closed side - #2076

Open
Prem-gosavi45 wants to merge 2 commits into
pandas-dev:mainfrom
Prem-gosavi45:fix/interval-dtype-generic-closed
Open

Prem-gosavi45 wants to merge 2 commits into
pandas-dev:mainfrom
Prem-gosavi45:fix/interval-dtype-generic-closed

Conversation

@Prem-gosavi45

Copy link
Copy Markdown
Contributor

Closes #2014

Make IntervalDtype generic over its closed parameter to preserve literal types when accessing the closed property.

  • Add a type variable for the closed side, with a default that preserves existing typing behaviour.
  • Update the constructor and closed property annotations.
  • Add type assertions covering all four closed values: "both", "left", "right", and "neither".
  • Preserve the default constructor typing behaviour.

Validation:

  • poetry run poe test — passed
  • 3510 passed, 5 skipped
  • 62 architecture tests passed
  • All type checkers and pre-commit hooks 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.

TYP: make IntervalDtype generic over its closed side

1 participant