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
83
83
- Improved deprecation message for offset aliases (:issue: `60820 `)
84
84
- Multiplying two :class: `DateOffset ` objects will now raise a ``TypeError `` instead of a ``RecursionError `` (:issue: `59442 `)
85
85
- 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 `)
86
87
- Support passing a :class: `Iterable[Hashable] ` input to :meth: `DataFrame.drop_duplicates ` (:issue: `59237 `)
87
88
- Support reading Stata 102-format (Stata 1) dta files (:issue: `58978 `)
88
89
- Support reading Stata 110-format (Stata 7) dta files (:issue: `47176 `)
Original file line number Diff line number Diff line change 10
10
import functools
11
11
from typing import (
12
12
TYPE_CHECKING ,
13
+ Any ,
13
14
final ,
14
15
)
15
16
import warnings
20
21
if TYPE_CHECKING :
21
22
from collections .abc import Callable
22
23
24
+ from pandas .core .frame import DataFrame
23
25
from pandas ._typing import TypeT
24
26
25
27
from pandas import Index
26
28
from pandas .core .generic import NDFrame
27
29
28
-
29
30
from importlib_metadata import entry_points
30
31
31
32
@@ -401,18 +402,18 @@ def register_index_accessor(name: str) -> Callable[[TypeT], TypeT]:
401
402
class DataFrameAccessorLoader :
402
403
"""Loader class for registering DataFrame accessors via entry points."""
403
404
404
- ENTRY_POINT_GROUP = "pandas_dataframe_accessor"
405
+ ENTRY_POINT_GROUP : str = "pandas_dataframe_accessor"
405
406
406
407
@classmethod
407
- def load (cls ):
408
+ def load (cls ) -> None :
408
409
"""loads and registers accessors defined by 'pandas_dataframe_accessor'."""
409
410
eps = entry_points (group = cls .ENTRY_POINT_GROUP )
410
411
411
412
for ep in eps :
412
- name = ep .name
413
+ name : str = ep .name
413
414
414
- def make_property (ep ):
415
- def accessor (self ):
415
+ def make_property (ep ) -> Callable [[ DataFrame ], Any ] :
416
+ def accessor (self ) -> Any :
416
417
cls_ = ep .load ()
417
418
return cls_ (self )
418
419
You can’t perform that action at this time.
0 commit comments