Is
for c in df.columns: if df.schema[c].dataType != 'string': print("Error")
what you are looking for?