Coverage for pystratum_common/helper/DataTypeHelper.py: 0%

7 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-13 08:46 +0200

1import abc 

2from typing import Any, Dict 

3 

4 

5class DataTypeHelper(metaclass=abc.ABCMeta): 

6 """ 

7 Utility class for deriving information based on a DBMS native data type. 

8 """ 

9 

10 # ------------------------------------------------------------------------------------------------------------------ 

11 @abc.abstractmethod 

12 def column_type_to_python_type(self, data_type_info: Dict[str, Any]) -> str: 

13 """ 

14 Returns the corresponding Python data type of DBMS native data type. 

15 

16 :param dict data_type_info: The DBMS native data type metadata. 

17 """ 

18 raise NotImplementedError() 

19 

20 # ------------------------------------------------------------------------------------------------------------------ 

21 @abc.abstractmethod 

22 def column_type_to_python_type_hint(self, data_type_info: Dict[str, Any]) -> str: 

23 """ 

24 Returns the corresponding Python data type hint of a MySQL data type. 

25 

26 :param dict data_type_info: The MySQL data type metadata. 

27 """ 

28 raise NotImplementedError() 

29 

30# ----------------------------------------------------------------------------------------------------------------------