File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ Other enhancements
8383- Improved deprecation message for offset aliases (:issue: `60820 `)
8484- Multiplying two :class: `DateOffset ` objects will now raise a ``TypeError `` instead of a ``RecursionError `` (:issue: `59442 `)
8585- Restore support for reading Stata 104-format and enable reading 103-format dta files (:issue: `58554 `)
86+ - Support :class: `DataFrame ` plugin accessor via entry points (:issue: `29076 `)
8687- Support passing a :class: `Iterable[Hashable] ` input to :meth: `DataFrame.drop_duplicates ` (:issue: `59237 `)
8788- Support reading Stata 102-format (Stata 1) dta files (:issue: `58978 `)
8889- Support reading Stata 110-format (Stata 7) dta files (:issue: `47176 `)
Original file line number Diff line number Diff line change 1010import functools
1111from typing import (
1212 TYPE_CHECKING ,
13+ Any ,
1314 final ,
1415)
1516import warnings
2021if TYPE_CHECKING :
2122 from collections .abc import Callable
2223
24+ from pandas .core .frame import DataFrame
2325 from pandas ._typing import TypeT
2426
2527 from pandas import Index
2628 from pandas .core .generic import NDFrame
2729
28-
2930from importlib_metadata import entry_points
3031
3132
@@ -401,18 +402,18 @@ def register_index_accessor(name: str) -> Callable[[TypeT], TypeT]:
401402class DataFrameAccessorLoader :
402403 """Loader class for registering DataFrame accessors via entry points."""
403404
404- ENTRY_POINT_GROUP = "pandas_dataframe_accessor"
405+ ENTRY_POINT_GROUP : str = "pandas_dataframe_accessor"
405406
406407 @classmethod
407- def load (cls ):
408+ def load (cls ) -> None :
408409 """loads and registers accessors defined by 'pandas_dataframe_accessor'."""
409410 eps = entry_points (group = cls .ENTRY_POINT_GROUP )
410411
411412 for ep in eps :
412- name = ep .name
413+ name : str = ep .name
413414
414- def make_property (ep ):
415- def accessor (self ):
415+ def make_property (ep ) -> Callable [[ DataFrame ], Any ] :
416+ def accessor (self ) -> Any :
416417 cls_ = ep .load ()
417418 return cls_ (self )
418419
You can’t perform that action at this time.
0 commit comments