{"record":{"id":"580894bd4072d4d9","repo":"apache/beam","slug":"invalid-process-variables-s-expected-assignment-in-the-form","errorCode":null,"errorMessage":"Invalid process_variables \"%s\" (expected assignment in the form \"FOO=bar\").","messagePattern":"Invalid process_variables \"(.+?)\" \\(expected assignment in the form \"FOO=bar\"\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/environments.py","lineNumber":482,"sourceCode":"    return ProcessEnvironment(\n        command=payload.command,\n        os=payload.os,\n        arch=payload.arch,\n        env=payload.env,\n        capabilities=capabilities,\n        artifacts=artifacts,\n        resource_hints=resource_hints,\n    )\n\n  @staticmethod\n  def parse_environment_variables(variables):\n    env = {}\n    for var in variables:\n      try:\n        name, value = var.split('=', 1)\n        env[name] = value\n      except ValueError:\n        raise ValueError(\n            'Invalid process_variables \"%s\" (expected assignment in the '\n            'form \"FOO=bar\").' % var)\n    return env\n\n  @classmethod\n  def from_options(cls, options):\n    # type: (PortableOptions) -> ProcessEnvironment\n    if options.environment_config:\n      config = json.loads(options.environment_config)\n      return cls(\n          config.get('command'),\n          os=config.get('os', ''),\n          arch=config.get('arch', ''),\n          env=config.get('env', ''),\n          capabilities=python_sdk_capabilities(),\n          artifacts=python_sdk_dependencies(options),\n          resource_hints=resource_hints_from_options(options),\n      )","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/environments.py#L464-L500","documentation":"ProcessEnvironment.parse_environment_variables splits each process_variables entry on '=' to build an env dict; entries without an '=' raise ValueError telling the user each entry must look like 'FOO=bar'.","triggerScenarios":"Passing --process_variables=FOO (no '='), or an entry like '=bar' handled by split succeeding but malformed input such as 'FOO' alone; any entry where var.split('=', 1) does not yield two parts.","commonSituations":"Shell quoting mistakes dropping the =value part, setting a variable without a value, or YAML/CLI config joining arguments incorrectly.","solutions":["Ensure every entry contains '=' in NAME=VALUE form (e.g. --process_variables=FOO=bar,BAZ=qux).","Quote the argument in your shell so '=' is preserved.","For an empty value use NAME= explicitly."],"exampleFix":"// before\n--process_variables=MY_VAR\n// after\n--process_variables=MY_VAR=1","handlingStrategy":"validation","validationCode":"def valid_process_vars(raw):\n    return all('=' in v for v in raw.split(','))","typeGuard":null,"tryCatchPattern":"try:\n    env = ProcessEnvironment.parse_environment_variables(variables)\nexcept ValueError as e:\n    logging.error('Bad process_variables entry: %s', e)","preventionTips":["Always quote --process_variables in shell scripts.","Use NAME= with explicit empty value rather than bare NAME."],"tags":["beam","environment","argument-format","cli","process-environment"],"backgroundTag":"invalid-argument-format","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"}