{"record":{"id":"54eaff75a1d1cf36","repo":"apache/beam","slug":"runner-s-is-not-a-pipelinerunner-object-or-the-name-of-a","errorCode":null,"errorMessage":"Runner %s is not a PipelineRunner object or the name of a registered runner.","messagePattern":"Runner (.+?) is not a PipelineRunner object or the name of a registered runner\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/pipeline.py","lineNumber":208,"sourceCode":"            argv)\n    else:\n      self._options = PipelineOptions([])\n\n    FileSystems.set_options(self._options)\n\n    if runner is None:\n      runner = self._options.view_as(StandardOptions).runner\n      if runner is None:\n        runner = StandardOptions.DEFAULT_RUNNER\n        logging.info((\n            'Missing pipeline option (runner). Executing pipeline '\n            'using the default runner: %s.'),\n                     runner)\n\n    if isinstance(runner, str):\n      runner = create_runner(runner)\n    elif not isinstance(runner, PipelineRunner):\n      raise TypeError(\n          'Runner %s is not a PipelineRunner object or the '\n          'name of a registered runner.' % runner)\n\n    # Runner can override the default pickler to be used.\n    if (self._options.view_as(SetupOptions).pickle_library == 'default' and\n        runner.default_pickle_library_override()):\n      logging.info(\n          \"Runner defaulting to pickling library: %s.\",\n          runner.default_pickle_library_override())\n      self._options.view_as(\n          SetupOptions).pickle_library = runner.default_pickle_library_override(\n          )\n    pickler.set_library(self._options.view_as(SetupOptions).pickle_library)\n\n    # Validate pipeline options\n    errors = PipelineOptionsValidator(self._options, runner).validate()\n    if errors:\n      raise ValueError(","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/pipeline.py#L190-L226","documentation":"Pipeline.__init__ raises TypeError when the `runner` argument is neither a PipelineRunner instance nor a string naming a registered runner. Beam resolves runners either from an object or by looking up a name in the runner registry; anything else cannot be used to execute the pipeline.","triggerScenarios":"Calling Pipeline(runner=SOMETHING) where runner is an arbitrary object (e.g. a class instead of an instance, a misspelled non-registered string that somehow bypassed create_runner, or None-like custom object) and not an instance of PipelineRunner.","commonSituations":"Passing the runner class (DirectRunner) instead of an instance or string 'DirectRunner'; passing a custom runner object that doesn't subclass PipelineRunner; typos in runner names that fall through custom resolution logic.","solutions":["Pass a registered runner name string, e.g. Pipeline(runner='DirectRunner') or 'FlinkRunner'.","Pass an instance: Pipeline(runner=DirectRunner()).","If using a custom runner, make it subclass apache_beam.runners.pipeline_context/PipelineRunner and register it.","Check the variable you're passing isn't the class itself (DirectRunner vs DirectRunner())."],"exampleFix":"// before\npipeline = Pipeline(runner=DirectRunner)\n// after\npipeline = Pipeline(runner=DirectRunner())  # or runner='DirectRunner'","handlingStrategy":"type-guard","validationCode":"def check_runner(runner):\n    from apache_beam.pipeline import Pipeline\n    from apache_beam.runners.runner import PipelineRunner\n    assert isinstance(runner, (str, PipelineRunner)), f'bad runner: {runner}'","typeGuard":"def is_valid_runner(r) -> bool:\n    from apache_beam.runners.runner import PipelineRunner\n    return isinstance(r, PipelineRunner) or (isinstance(r, str) and bool(r))","tryCatchPattern":null,"preventionTips":["Pass runner by registered name string when in doubt","Pass instances, not classes","Register custom runners before constructing the Pipeline"],"tags":["python","apache-beam","type-error","runner"],"backgroundTag":"invalid-argument-value","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"}