xoverrr 1.1.4__py3-none-any.whl → 1.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xoverrr/__init__.py +8 -12
- xoverrr/adapters/__init__.py +7 -2
- xoverrr/adapters/base.py +61 -32
- xoverrr/adapters/clickhouse.py +64 -35
- xoverrr/adapters/oracle.py +67 -38
- xoverrr/adapters/postgres.py +67 -35
- xoverrr/constants.py +4 -4
- xoverrr/core.py +299 -197
- xoverrr/exceptions.py +8 -1
- xoverrr/logger.py +4 -2
- xoverrr/models.py +11 -5
- xoverrr/utils.py +331 -259
- {xoverrr-1.1.4.dist-info → xoverrr-1.1.6.dist-info}/METADATA +67 -71
- xoverrr-1.1.6.dist-info/RECORD +17 -0
- {xoverrr-1.1.4.dist-info → xoverrr-1.1.6.dist-info}/WHEEL +1 -1
- xoverrr-1.1.4.dist-info/RECORD +0 -17
- {xoverrr-1.1.4.dist-info → xoverrr-1.1.6.dist-info}/licenses/LICENSE +0 -0
- {xoverrr-1.1.4.dist-info → xoverrr-1.1.6.dist-info}/top_level.txt +0 -0
xoverrr/exceptions.py
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
class DQCompareException(Exception):
|
|
2
2
|
"""Base exception for data quality comparison errors"""
|
|
3
|
+
|
|
3
4
|
pass
|
|
4
5
|
|
|
6
|
+
|
|
5
7
|
class MetadataError(DQCompareException):
|
|
6
8
|
"""Exception raised for metadata-related errors"""
|
|
9
|
+
|
|
7
10
|
pass
|
|
8
11
|
|
|
12
|
+
|
|
9
13
|
class QueryExecutionError(DQCompareException):
|
|
10
14
|
"""Exception raised for query execution failures"""
|
|
15
|
+
|
|
11
16
|
pass
|
|
12
17
|
|
|
18
|
+
|
|
13
19
|
class TypeConversionError(DQCompareException):
|
|
14
20
|
"""Exception raised for type conversion failures"""
|
|
15
|
-
|
|
21
|
+
|
|
22
|
+
pass
|
xoverrr/logger.py
CHANGED
|
@@ -3,9 +3,11 @@ import logging
|
|
|
3
3
|
app_logger = logging.getLogger(__name__)
|
|
4
4
|
app_logger.setLevel(logging.INFO)
|
|
5
5
|
|
|
6
|
-
formatter = logging.Formatter(
|
|
6
|
+
formatter = logging.Formatter(
|
|
7
|
+
'%(asctime)s - %(levelname)s - xoverrr.%(module)s.%(funcName)s - %(message)s'
|
|
8
|
+
)
|
|
7
9
|
|
|
8
10
|
console_handler = logging.StreamHandler()
|
|
9
11
|
console_handler.setLevel(logging.INFO)
|
|
10
12
|
console_handler.setFormatter(formatter)
|
|
11
|
-
app_logger.addHandler(console_handler)
|
|
13
|
+
app_logger.addHandler(console_handler)
|
xoverrr/models.py
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
import re
|
|
1
2
|
from dataclasses import dataclass
|
|
2
3
|
from enum import Enum, auto
|
|
3
4
|
from typing import Optional
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
from sqlalchemy.engine import Engine
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
class ObjectType(Enum):
|
|
8
10
|
"""Types of database objects"""
|
|
11
|
+
|
|
9
12
|
TABLE = auto()
|
|
10
13
|
VIEW = auto()
|
|
11
14
|
MATERIALIZED_VIEW = auto()
|
|
12
15
|
UNKNOWN = auto()
|
|
13
16
|
|
|
17
|
+
|
|
14
18
|
class DBMSType(Enum):
|
|
15
19
|
"""Supported database management systems"""
|
|
20
|
+
|
|
16
21
|
ORACLE = auto()
|
|
17
22
|
POSTGRESQL = auto()
|
|
18
23
|
CLICKHOUSE = auto()
|
|
@@ -27,12 +32,13 @@ class DBMSType(Enum):
|
|
|
27
32
|
return cls.POSTGRESQL
|
|
28
33
|
elif dialect == 'clickhouse':
|
|
29
34
|
return cls.CLICKHOUSE
|
|
30
|
-
raise ValueError(f
|
|
35
|
+
raise ValueError(f'Unsupported engine dialect: {dialect}')
|
|
31
36
|
|
|
32
37
|
|
|
33
38
|
@dataclass(frozen=True)
|
|
34
39
|
class DataReference:
|
|
35
40
|
"""Immutable reference to a database object"""
|
|
41
|
+
|
|
36
42
|
name: str
|
|
37
43
|
schema: Optional[str] = None
|
|
38
44
|
|
|
@@ -42,11 +48,11 @@ class DataReference:
|
|
|
42
48
|
def _validate(self):
|
|
43
49
|
"""Validate table reference parameters"""
|
|
44
50
|
if not re.match(r'^[a-zA-Z0-9_]+$', self.name):
|
|
45
|
-
raise ValueError(f
|
|
51
|
+
raise ValueError(f'Invalid table name: {self.name}')
|
|
46
52
|
if self.schema and not re.match(r'^[a-zA-Z0-9_]+$', self.schema):
|
|
47
|
-
raise ValueError(f
|
|
53
|
+
raise ValueError(f'Invalid schema name: {self.schema}')
|
|
48
54
|
|
|
49
55
|
@property
|
|
50
56
|
def full_name(self) -> str:
|
|
51
57
|
"""Get fully qualified object name"""
|
|
52
|
-
return f
|
|
58
|
+
return f'{self.schema}.{self.name}' if self.schema else self.name
|