{"record":{"id":"470bac02bb06e5c9","repo":"apache/beam","slug":"received-value-none-for-key-s-none-values-are-currently-not","errorCode":null,"errorMessage":"Received value None for key %s. None values are currently not supported","messagePattern":"Received value None for key (.+?)\\. None values are currently not supported","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/external.py","lineNumber":148,"sourceCode":"    raise NotImplementedError\n\n  def payload(self):\n    \"\"\"\n    The serialized ExternalConfigurationPayload\n\n    :return: bytes\n    \"\"\"\n    return self.build().SerializeToString()\n\n  def _get_schema_proto_and_payload(self, **kwargs):\n    named_fields = []\n    fields_to_values = OrderedDict()\n\n    for key, value in kwargs.items():\n      if not key:\n        raise ValueError('Parameter name cannot be empty')\n      if value is None:\n        raise ValueError(\n            'Received value None for key %s. None values are currently not '\n            'supported' % key)\n      named_fields.append(\n          (key, convert_to_typing_type(instance_to_type(value))))\n      fields_to_values[key] = value\n\n    schema_proto = named_fields_to_schema(named_fields)\n    row = named_tuple_from_schema(schema_proto)(**fields_to_values)\n    schema = named_tuple_to_schema(type(row))\n\n    payload = RowCoder(schema).encode(row)\n    return (schema_proto, payload)\n\n\nclass SchemaBasedPayloadBuilder(PayloadBuilder):\n  \"\"\"\n  Base class for building payloads based on a schema that provides\n  type information for each configuration value to encode.","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/external.py#L130-L166","documentation":"SchemaTransform builder fields map Python values to schema-typed fields, and Beam does not know how to represent None as a typed field value in this path. Passing None as any keyword value to build() raises this ValueError with the offending key name.","triggerScenarios":"Calling builder.build(field=None) or passing a dict with None values via **kwargs to a SchemaTransform provider's build().","commonSituations":"Config-driven pipelines where optional settings are None by default, or merging partial configurations into kwargs.","solutions":["Omit None-valued keys entirely instead of passing them (fields default when absent).","Substitute explicit non-None defaults (e.g. '' , 0) when the schema expects a value.","Filter kwargs: build(**{k: v for k, v in kwargs.items() if v is not None})."],"exampleFix":"# before\nbuilder.build(path=input_path, batch_size=None)\n# after\nbuilder.build(path=input_path)  # omit None fields; set defaults explicitly if required","handlingStrategy":"validation","validationCode":"nones = [k for k, v in kwargs.items() if v is None]\nif nones:\n    raise ValueError('None values not supported for: %r' % nones)\nbuilder.build(**kwargs)","typeGuard":"def no_none_values(kwargs) -> bool:\n    return all(v is not None for v in kwargs.values())","tryCatchPattern":"try:\n    builder.build(**kwargs)\nexcept ValueError as e:\n    if 'None values are currently not supported' in str(e):\n        builder.build(**{k: v for k, v in kwargs.items() if v is not None})\n    else:\n        raise","preventionTips":["Filter None values out of config dicts before build().","Give optional settings concrete defaults instead of None.","Keep optional schema fields absent rather than None."],"tags":["python","apache-beam","cross-language","null-value"],"backgroundTag":"null-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}