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

14 statements  

« prev     ^ index     » next       coverage.py v7.4.3, created at 2024-02-26 10:12 +0000

1""" 

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

3""" 

4 

5from typing import Any, Callable, Sequence 

6 

7from ipyvizzu.__version__ import PYENV 

8 

9 

10if PYENV >= (3, 8): 

11 from typing import Protocol, runtime_checkable 

12else: 

13 # TODO: remove once support for Python 3.7 is dropped 

14 # pylint: disable=duplicate-code 

15 from typing_extensions import Protocol, runtime_checkable # type: ignore 

16 

17 

18@runtime_checkable 

19class SparkDataFrame(Protocol): 

20 """ 

21 Represents a pyspark DataFrame Protocol. 

22 """ 

23 

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

25 

26 columns: Sequence[str] 

27 count: Callable[..., int] 

28 sample: Callable[..., Any] 

29 limit: Callable[..., Any] 

30 select: Callable[..., Any] 

31 withColumn: Callable[..., Any] 

32 rdd: Any