{"record":{"id":"f032447d720e1114","repo":"apache/beam","slug":"disabling-dataflow-portable-runner-no-longer-supported-using","errorCode":null,"errorMessage":"Disabling Dataflow Portable Runner no longer supported using Beam Python %s.","messagePattern":"Disabling Dataflow Portable Runner no longer supported using Beam Python (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/dataflow/dataflow_runner.py","lineNumber":354,"sourceCode":"      def _overrides_setup_or_teardown(combinefn):\n        # TODO(https://github.com/apache/beam/issues/18716): provide an\n        # implementation for this method\n        return False\n\n    return CombineFnVisitor()\n\n  def _adjust_pipeline_for_dataflow_v2(self, pipeline):\n    # Dataflow runner requires a KV type for GBK inputs, hence we enforce that\n    # here.\n    pipeline.visit(\n        group_by_key_input_visitor(\n            not pipeline._options.view_as(\n                TypeOptions).allow_non_deterministic_key_coders))\n\n  def run_pipeline(self, pipeline, options, pipeline_proto=None):\n    \"\"\"Remotely executes entire pipeline or parts reachable from node.\"\"\"\n    if _is_runner_v2_disabled(options):\n      raise ValueError(\n          'Disabling Dataflow Portable Runner no longer supported '\n          'using Beam Python %s.' % beam.version.__version__)\n\n    # Label goog-dataflow-notebook if job is started from notebook.\n    if is_in_notebook():\n      notebook_version = (\n          'goog-dataflow-notebook=' +\n          beam.version.__version__.replace('.', '_'))\n      if options.view_as(GoogleCloudOptions).labels:\n        options.view_as(GoogleCloudOptions).labels.append(notebook_version)\n      else:\n        options.view_as(GoogleCloudOptions).labels = [notebook_version]\n\n    # Import here to avoid adding the dependency for local running scenarios.\n    try:\n      # pylint: disable=wrong-import-order, wrong-import-position\n      from apache_beam.runners.dataflow.internal import apiclient\n    except ImportError:","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py#L336-L372","documentation":"This ValueError guards against opting out of Dataflow Runner v2. Newer Apache Beam Python SDK versions dropped support for the legacy (non-portable) Dataflow runner, so any pipeline option or experiment that disables Runner v2 causes run_pipeline to refuse to submit the job, reporting the SDK version in use.","triggerScenarios":"Submitting a Dataflow pipeline with an option/experiment that disables Runner v2 (e.g. --experiments=disable_runner_v2 / dataflow_runner_v2=False) while using a Beam Python version where that toggle was removed; detected via _is_runner_v2_disabled(options).","commonSituations":"Upgrading apache-beam while keeping old job-submission scripts that pinned the legacy runner; copying pipeline options from older documentation or templates.","solutions":["Remove the runner-v2-disabling option/experiment from pipeline options.","Upgrade or downgrade apache-beam so the SDK version matches the runner mode you need (older SDKs still allow legacy runner).","Migrate the pipeline to Runner v2 and verify supported features (e.g. CombineFn.setup/teardown).","Test with the DirectRunner first to catch behavior differences after dropping the legacy flag."],"exampleFix":"// before\n--experiments=disable_runner_v2\n// after\n# remove the experiment; use the default Dataflow Runner v2","handlingStrategy":"validation","validationCode":"if 'disable_runner_v2' in (opts.view_as(TypeOptions).experiments or []):\n    raise SystemExit('disable_runner_v2 no longer supported by this Beam SDK')","typeGuard":null,"tryCatchPattern":"try:\n    pipeline.run()\nexcept ValueError as e:\n    if 'Portable Runner no longer supported' in str(e):\n        opts.view_as(TypeOptions).experiments = [x for x in (opts.view_as(TypeOptions).experiments or []) if x != 'disable_runner_v2']\n        pipeline.run()","preventionTips":["Audit job-submission scripts for legacy runner flags after SDK upgrades","Keep pipeline-option templates in sync with the Beam version in use","Pin Beam versions in CI so option compatibility is tested explicitly"],"tags":["python","apache-beam","dataflow","runner-v2","deprecated"],"backgroundTag":"deprecated-api-usage","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}