Added another cast method to dataset class generator