Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pandas/core/ops/dispatch.py: 83%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

6 statements  

1""" 

2Functions for defining unary operations. 

3""" 

4from __future__ import annotations 

5 

6from typing import Any 

7 

8from pandas._typing import ArrayLike 

9 

10from pandas.core.dtypes.generic import ABCExtensionArray 

11 

12 

13def should_extension_dispatch(left: ArrayLike, right: Any) -> bool: 

14 """ 

15 Identify cases where Series operation should dispatch to ExtensionArray method. 

16 

17 Parameters 

18 ---------- 

19 left : np.ndarray or ExtensionArray 

20 right : object 

21 

22 Returns 

23 ------- 

24 bool 

25 """ 

26 return isinstance(left, ABCExtensionArray) or isinstance(right, ABCExtensionArray)