{"record":{"id":"562eebe566625413","repo":"apache/beam","slug":"unsupported-runner-s","errorCode":null,"errorMessage":"Unsupported runner %s.","messagePattern":"Unsupported runner (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/interactive/sql/beam_sql_magics.py","lineNumber":242,"sourceCode":"      collect_data_for_local_run(query, found)\n      output_name, output, chain = apply_sql(query, output_name, found)\n      chain.current.schemas = schemas\n      cache_output(output_name, output)\n      return output\n\n    output_name, current_node, chain = apply_sql(\n        query, output_name, found, False)\n    current_node.schemas = schemas\n    # TODO(BEAM-10708): Move the options setup and result handling to a\n    # separate module when more runners are supported.\n    if runner == 'DataflowRunner':\n      _ = chain.to_pipeline()\n      _ = DataflowOptionsForm(\n          output_name, pcoll_by_name()[output_name],\n          verbose).display_for_input()\n      return None\n    else:\n      raise ValueError('Unsupported runner %s.', runner)\n\n\n@progress_indicated\ndef collect_data_for_local_run(query: str, found: dict[str, beam.PCollection]):\n  from apache_beam.runners.interactive import interactive_beam as ib\n  for name, pcoll in found.items():\n    try:\n      _ = ib.collect(pcoll)\n    except (KeyboardInterrupt, SystemExit):\n      raise\n    except:  # pylint: disable=bare-except\n      _LOGGER.error(\n          'Cannot collect data for PCollection %s. Please make sure the '\n          'PCollections queried in the sql \"%s\" are all from a single '\n          'pipeline using an InteractiveRunner. Make sure there is no '\n          'ambiguity, for example, same named PCollections from multiple '\n          'pipelines or notebook re-executions.',\n          name,","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/interactive/sql/beam_sql_magics.py#L224-L260","documentation":"The %%beam_sql magic dispatches to a runner-specific flow (DirectRunner local run or Dataflow form); if the detected/configured runner is neither, it raises ValueError('Unsupported runner %s.', runner). Note the comma means the arguments are never formatted into the message by a bare raise, but the intent is that only DirectRunner and DataflowRunner are supported.","triggerScenarios":"Running %%beam_sql with apache_beam.options.pipeline_options runner set to something other than DirectRunner or DataflowRunner (e.g. FlinkRunner, SparkRunner, or a typo'd runner name).","commonSituations":"Notebooks with --runner FlinkRunner in PipelineOptions; misspelled runner class; environments where the magic cannot detect a supported runner from the options.","solutions":["Set the runner to DirectRunner for local execution or DataflowRunner for GCP before running the magic","Check the PipelineOptions / %%capture magic configuration for a typo in the runner name","Wrap the runner in an interactive environment that maps to a supported backend","If you need another runner, execute the SqlChain manually instead of the magic"],"exampleFix":"// before\noptions = PipelineOptions(['--runner=FlinkRunner'])\n%%beam_sql output\n// after\noptions = PipelineOptions(['--runner=DirectRunner'])\n%%beam_sql output","handlingStrategy":"validation","validationCode":"runner = options.view_as(PipelineOptions).get_all_options().get('runner')\nif runner and 'DirectRunner' not in str(runner) and 'DataflowRunner' not in str(runner):\n    raise ValueError(f'%%beam_sql supports DirectRunner/DataflowRunner only, got {runner}')","typeGuard":"def is_supported_runner(runner):\n    name = str(runner)\n    return 'DirectRunner' in name or 'DataflowRunner' in name","tryCatchPattern":"try:\n    get_ipython().run_cell_magic('beam_sql', ..., ...)\nexcept ValueError as e:\n    if 'Unsupported runner' in str(e):\n        options.pipeline_options(['--runner=DirectRunner'])","preventionTips":["Keep --runner as DirectRunner or DataflowRunner when using %%beam_sql","Avoid typos in runner class names in PipelineOptions","Check the detected runner before invoking the magic","Use SqlChain directly if you need another runner"],"tags":["sql","unsupported-runner","interactive-beam"],"backgroundTag":"unsupported-operation","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"}