xoverrr 1.1.5__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/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
- pass
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('%(asctime)s - %(levelname)s - xoverrr.%(module)s.%(funcName)s - %(message)s')
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
- import re
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"Unsupported engine dialect: {dialect}")
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"Invalid table name: {self.name}")
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"Invalid schema name: {self.schema}")
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"{self.schema}.{self.name}" if self.schema else self.name
58
+ return f'{self.schema}.{self.name}' if self.schema else self.name