Skip to content

Commit 5b82f59

Browse files
author
samuel.solarte@qubika.com
committed
DC-308 fix: place normalization function out of class.
1 parent de70d1e commit 5b82f59

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

src/migration_accelerator_package/artifact_validators.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
from migration_accelerator_package.constants import ArtifactType, ArtifactFileName
1010
from databricks.sdk.runtime import *
1111

12+
def normalize_column(col: Dict[str, Any]) -> Dict[str, Any]:
13+
"""
14+
Normalize column metadata for comparison.
15+
Only keeps the essential fields needed for correctness validation.
16+
"""
17+
col = {k.lower(): v for k, v in col.items()}
18+
19+
return {
20+
"column_name": col.get("column_name"),
21+
"data_type": col.get("data_type"),
22+
"is_nullable": col.get("is_nullable"),
23+
}
24+
25+
1226
class MetadataValidator:
1327
"""
1428
Validates completeness and correctness of extracted Snowflake metadata.
@@ -101,19 +115,6 @@ def validate_completeness(self, extracted: Dict[str, Any], db: str, schema: str)
101115

102116
return completeness
103117

104-
def normalize_column(col: Dict[str, Any]) -> Dict[str, Any]:
105-
"""
106-
Normalize column metadata for comparison.
107-
Only keeps the essential fields needed for correctness validation.
108-
"""
109-
col = {k.lower(): v for k, v in col.items()}
110-
111-
return {
112-
"column_name": col.get("column_name"),
113-
"data_type": col.get("data_type"),
114-
"is_nullable": col.get("is_nullable"),
115-
}
116-
117118
def validate_table_definition(self, db, schema, extracted_table: Dict[str, Any]) -> Dict[str, Any]:
118119
table_name = extracted_table["table_name"]
119120

0 commit comments

Comments
 (0)