in data_validation/schema_validation.py [0:0]
def parse_n_validate_datatypes(source, target) -> tuple:
"""
Args:
source: Source table datatype string
target: Target table datatype string
Returns:
bool:target has higher precision value
bool:target has lower precision value
"""
if strip_null(source) == target:
return False, False
if "(" in source and "(" in target:
typeb_source = get_typeb_numeric_sustr(source)
typeb_target = get_typeb_numeric_sustr(target)
higher_precision, lower_precision = validate_typeb_vals(
typeb_source, typeb_target
)
return higher_precision, lower_precision
source_num = get_typea_numeric_sustr(source)
target_num = get_typea_numeric_sustr(target)
# In case of no bits specified, we will not match for precisions
if source_num == -1 or target_num == -1:
return False, False
if source_num == target_num:
return False, False
elif source_num > target_num:
return False, True
return False, False