def compare_type(self, ctxt, insp_col, meta_col, insp_type, meta_type):
    if isinstance(meta_type, types.Variant):
        meta_orig_type = meta_col.type
        insp_orig_type = insp_col.type
        meta_col.type = meta_type.impl
        insp_col.type = meta_type.impl
        try:
            return self.compare_type(ctxt, insp_col, meta_col, insp_type, meta_type.impl)
        finally:
            meta_col.type = meta_orig_type
            insp_col.type = insp_orig_type
    else:
        ret = super(ModelsMigrationSyncMixin, self).compare_type(ctxt, insp_col, meta_col, insp_type, meta_type)
        if (ret is not None):
            return ret
        return ctxt.impl.compare_type(insp_col, meta_col)
def compare_type(self, ctxt, insp_col, meta_col, insp_type, meta_type):
    if isinstance(meta_type, types.Variant):
        meta_orig_type = meta_col.type
        insp_orig_type = insp_col.type
        meta_col.type = meta_type.impl
        insp_col.type = meta_type.impl
        try:
            return self.compare_type(ctxt, insp_col, meta_col, insp_type, meta_type.impl)
        finally:
            meta_col.type = meta_orig_type
            insp_col.type = insp_orig_type
    else:
        ret = super(ModelsMigrationSyncMixin, self).compare_type(ctxt, insp_col, meta_col, insp_type, meta_type)
        if (ret is not None):
            return ret
        return ctxt.impl.compare_type(insp_col, meta_col)