MCPcopy Create free account
hub / github.com/dask/dask / _register_accessor

Function _register_accessor

dask/dataframe/accessor.py:88–102  ·  view source on GitHub ↗
(name, cls)

Source from the content-addressed store, hash-verified

86
87
88def _register_accessor(name, cls):
89 def decorator(accessor):
90 if hasattr(cls, name):
91 warnings.warn(
92 f"registration of accessor {accessor!r} under name {name!r} for type "
93 f"{cls!r} is overriding a preexisting attribute with the same "
94 "name.",
95 UserWarning,
96 stacklevel=2,
97 )
98 setattr(cls, name, CachedAccessor(name, accessor))
99 cls._accessors.add(name)
100 return accessor
101
102 return decorator
103
104
105def register_dataframe_accessor(name):

Callers 3

register_series_accessorFunction · 0.85
register_index_accessorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected