@@ -370,8 +370,6 @@ def get_group_levels(self) -> List[Index]:
370
370
371
371
_cython_arity = {"ohlc" : 4 } # OHLC
372
372
373
- _name_functions = {"ohlc" : ["open" , "high" , "low" , "close" ]}
374
-
375
373
def _is_builtin_func (self , arg ):
376
374
"""
377
375
if we define a builtin function for this argument, return it,
@@ -492,36 +490,33 @@ def _ea_wrap_cython_operation(
492
490
# All of the functions implemented here are ordinal, so we can
493
491
# operate on the tz-naive equivalents
494
492
values = values .view ("M8[ns]" )
495
- res_values , names = self ._cython_operation (
493
+ res_values = self ._cython_operation (
496
494
kind , values , how , axis , min_count , ** kwargs
497
495
)
498
496
if how in ["rank" ]:
499
497
# preserve float64 dtype
500
- return res_values , names
498
+ return res_values
501
499
502
500
res_values = res_values .astype ("i8" , copy = False )
503
501
result = type (orig_values )._simple_new (res_values , dtype = orig_values .dtype )
504
- return result , names
502
+ return result
505
503
506
504
elif is_integer_dtype (values .dtype ) or is_bool_dtype (values .dtype ):
507
505
# IntegerArray or BooleanArray
508
506
values = ensure_int_or_float (values )
509
- res_values , names = self ._cython_operation (
507
+ res_values = self ._cython_operation (
510
508
kind , values , how , axis , min_count , ** kwargs
511
509
)
512
510
result = maybe_cast_result (result = res_values , obj = orig_values , how = how )
513
- return result , names
511
+ return result
514
512
515
513
raise NotImplementedError (values .dtype )
516
514
517
515
def _cython_operation (
518
516
self , kind : str , values , how : str , axis : int , min_count : int = - 1 , ** kwargs
519
- ) -> Tuple [ np .ndarray , Optional [ List [ str ]]] :
517
+ ) -> np .ndarray :
520
518
"""
521
- Returns the values of a cython operation as a Tuple of [data, names].
522
-
523
- Names is only useful when dealing with 2D results, like ohlc
524
- (see self._name_functions).
519
+ Returns the values of a cython operation.
525
520
"""
526
521
orig_values = values
527
522
assert kind in ["transform" , "aggregate" ]
@@ -619,8 +614,6 @@ def _cython_operation(
619
614
if vdim == 1 and arity == 1 :
620
615
result = result [:, 0 ]
621
616
622
- names : Optional [List [str ]] = self ._name_functions .get (how , None )
623
-
624
617
if swapped :
625
618
result = result .swapaxes (0 , axis )
626
619
@@ -630,7 +623,7 @@ def _cython_operation(
630
623
dtype = maybe_cast_result_dtype (orig_values .dtype , how )
631
624
result = maybe_downcast_to_dtype (result , dtype )
632
625
633
- return result , names
626
+ return result
634
627
635
628
def _aggregate (
636
629
self , result , counts , values , comp_ids , agg_func , min_count : int = - 1
0 commit comments