var_string = ", ".join(attrs[:-1]) + ", " + attrs[-1]
return f"{sum(counts)} (" + var_string + ")"elif sum(counts)== 1:
var_string = attrs[0][2:]return var_string
else:
types = [s for s in ["categorical", "numeric", "time", "string"] if
s in attrs[0]]
After Change
// `isinstance`, which would fail in the above case
var_type_list = [v for v in variables iftype(v) is var_type] // pylint: disable=unidiomatic-typecheckif var_type_list:
not_shown = " (not shown)"ifissubclass(var_type, StringVariable)\
else ""
agg.append((f"{var_type_name}{not_shown}", len(var_type_list)))
attrs, counts = list(zip(*agg))
iflen(attrs) > 1: