Coverage for src/ipyvizzu/data/converters/pandas/protocol.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-02-26 15:29 +0000

1""" 

2This module provides protocol classes for pandas data frame converter. 

3""" 

4 

5from typing import Any, Callable, Protocol, Sequence, runtime_checkable 

6 

7 

8@runtime_checkable 

9class PandasDataFrame(Protocol): 

10 """ 

11 Represents a pandas DataFrame Protocol. 

12 """ 

13 

14 # pylint: disable=too-few-public-methods 

15 

16 index: Any 

17 columns: Sequence[str] 

18 sample: Callable[..., Any] 

19 __len__: Callable[[], int] 

20 __getitem__: Callable[[Any], Any] 

21 

22 

23@runtime_checkable 

24class PandasSeries(Protocol): 

25 """ 

26 Represents a pandas Series Protocol. 

27 """ 

28 

29 # pylint: disable=too-few-public-methods 

30 

31 index: Any 

32 values: Any 

33 dtype: Any 

34 __len__: Callable[[], int] 

35 __getitem__: Callable[[Any], Any]