Created
August 23, 2015 02:41
-
-
Save nobane/469047e8f3e7fcb447d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def my_compare_type(context, inspected_column, | |
metadata_column, inspected_type, metadata_type): | |
replace = dict( | |
VARCHAR='String', | |
BOOLEAN='Boolean', | |
DATETIME='DateTime', | |
INTEGER='Integer', | |
TEXT='Text' | |
) | |
pattern = re.compile( '|'.join(replace.keys())) | |
left = pattern.sub(lambda x: replace[x.group()], | |
inspected_column.type.__class__.__name__) | |
right = pattern.sub(lambda x: replace[x.group()], | |
metadata_column.type.__class__.__name__) | |
return left != right |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment