From b808fc1f071a69f13b9801cfe62ec4d8c50a11f1 Mon Sep 17 00:00:00 2001 From: Charles Lariviere Date: Thu, 16 Mar 2023 13:30:59 -0400 Subject: [PATCH] add missing field_name in ValueError --- petastorm/unischema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/petastorm/unischema.py b/petastorm/unischema.py index ba9ef029..1b07992b 100644 --- a/petastorm/unischema.py +++ b/petastorm/unischema.py @@ -387,7 +387,7 @@ def dict_to_spark_row(unischema, row_dict): schema_field = unischema.fields[field_name] if value is None: if not schema_field.nullable: - raise ValueError('Field {} is not "nullable", but got passes a None value') + raise ValueError(f'Field {field_name} is not "nullable", but got passes a None value') if schema_field.codec: encoded_dict[field_name] = schema_field.codec.encode(schema_field, value) if value is not None else None else: