{"record":{"id":"53cdbabac19ed2f2","repo":"apache/beam","slug":"received-value-none-none-values-are-currently-not-supported","errorCode":null,"errorMessage":"Received value None. None values are currently not supported","messagePattern":"Received value None\\. None values are currently not supported","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/external.py","lineNumber":312,"sourceCode":"  def __init__(self, class_name):\n    \"\"\"\n    :param class_name: fully qualified name of the transform class.\n    \"\"\"\n    if not class_name:\n      raise ValueError('Class name must not be empty')\n\n    self._class_name = class_name\n    self._constructor_method = None\n    self._constructor_param_args = None\n    self._constructor_param_kwargs = None\n    self._builder_methods_and_params = OrderedDict()\n\n  def _args_to_named_fields(self, args):\n    next_field_id = 0\n    named_fields = OrderedDict()\n    for value in args:\n      if value is None:\n        raise ValueError(\n            'Received value None. None values are currently not supported')\n      named_fields[(\n          JavaClassLookupPayloadBuilder.IGNORED_ARG_FORMAT %\n          next_field_id)] = value\n      next_field_id += 1\n    return named_fields\n\n  def build(self):\n    all_constructor_param_kwargs = self._args_to_named_fields(\n        self._constructor_param_args)\n    if self._constructor_param_kwargs:\n      all_constructor_param_kwargs.update(self._constructor_param_kwargs)\n    constructor_schema, constructor_payload = (\n      self._get_schema_proto_and_payload(**all_constructor_param_kwargs))\n    payload = external_transforms_pb2.JavaClassLookupPayload(\n        class_name=self._class_name,\n        constructor_schema=constructor_schema,\n        constructor_payload=constructor_payload)","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/external.py#L294-L330","documentation":"Positional (unnamed) arguments passed to the Java class builder are converted to synthetic named fields with ignored names; None is not a supported field value in this schema-based path, so _args_to_named_fields raises this ValueError when any positional arg is None.","triggerScenarios":"Calling with_constructor(None, ...) or build with positional args containing None, e.g. JavaClassLookupPayloadBuilder(cls).with_constructor(None).","commonSituations":"Defaulting optional constructor arguments to None in wrapper code; programmatically generated argument lists containing placeholders.","solutions":["Replace None positional args with concrete default values (e.g. '', 0) matching the Java constructor signature.","Omit trailing None args and use a different constructor overload via with_constructor with the non-None subset.","Use named kwargs with with_constructor only for non-None values."],"exampleFix":"# before\nbuilder.with_constructor(path, None)  # RuntimeError path: None arg\n# after\nbuilder.with_constructor(path, \"\")  # or omit and choose an overload without the arg","handlingStrategy":"validation","validationCode":"if any(a is None for a in args):\n    raise ValueError('None positional args not supported; use concrete defaults')\nbuilder.with_constructor(*args)","typeGuard":"def no_none_args(args) -> bool:\n    return all(a is not None for a in args)","tryCatchPattern":"try:\n    builder.with_constructor(*args)\nexcept ValueError as e:\n    if 'None values are currently not supported' in str(e):\n        builder.with_constructor(*[a if a is not None else default_for(i) for i, a in enumerate(args)])\n    else:\n        raise","preventionTips":["Replace optional-arg None placeholders with Java-side default values.","Trim trailing None args and pick a matching constructor overload.","Type-check generated argument lists before building the payload."],"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"}