infer_schema_from_csv: better error checking