as_dict() takes an argument to hide empty attributes