Skip to content

chore(typing): add CompliantSeries.dtype#2066

Merged
MarcoGorelli merged 1 commit intomainfrom
add-compliant-series-dtype
Feb 22, 2025
Merged

chore(typing): add CompliantSeries.dtype#2066
MarcoGorelli merged 1 commit intomainfrom
add-compliant-series-dtype

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Feb 22, 2025

What type of PR is this? (check all applicable)

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

Will simplify a workaround I've done in #2064 (comment)

Code block

# NOTE: Plugging the gap of this not being defined in `CompliantSeries`
class CompliantSeriesWithDType(CompliantSeries, Protocol):
@property
def dtype(self) -> DType: ...
SeriesT = TypeVar("SeriesT", bound="CompliantSeriesWithDType")

The property is available on all CompliantSeries already, but not visible to a type checker without this

Will simplify a workaround I've done in #2064 (comment)
Related: #2060
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

@MarcoGorelli MarcoGorelli merged commit f70d4fe into main Feb 22, 2025
28 of 30 checks passed
@MarcoGorelli MarcoGorelli deleted the add-compliant-series-dtype branch February 22, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants