{"record":{"id":"b0fe4613f9182ba3","repo":"apache/beam","slug":"transform-spec-urn","errorCode":null,"errorMessage":"{transform.spec.urn}","messagePattern":"\\{transform\\.spec\\.urn\\}","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/runner.py","lineNumber":218,"sourceCode":"\n  def check_requirements(\n      self,\n      pipeline_proto: beam_runner_api_pb2.Pipeline,\n      supported_requirements: Iterable[str]):\n    \"\"\"Check that this runner can satisfy all pipeline requirements.\"\"\"\n\n    # Imported here to avoid circular dependencies.\n    # pylint: disable=wrong-import-order, wrong-import-position\n    from apache_beam.runners.portability.fn_api_runner import translations\n    supported_requirements = set(supported_requirements)\n    for requirement in pipeline_proto.requirements:\n      if requirement not in supported_requirements:\n        raise ValueError(\n            'Unable to run pipeline with requirement: %s' % requirement)\n    for transform in pipeline_proto.components.transforms.values():\n      if transform.spec.urn == common_urns.primitives.TEST_STREAM.urn:\n        if common_urns.primitives.TEST_STREAM.urn not in supported_requirements:\n          raise NotImplementedError(transform.spec.urn)\n      elif transform.spec.urn in translations.PAR_DO_URNS:\n        payload = beam_runner_api_pb2.ParDoPayload.FromString(\n            transform.spec.payload)\n        for timer in payload.timer_family_specs.values():\n          if timer.time_domain not in (\n              beam_runner_api_pb2.TimeDomain.EVENT_TIME,\n              beam_runner_api_pb2.TimeDomain.PROCESSING_TIME):\n            raise NotImplementedError(timer.time_domain)\n\n  def default_pickle_library_override(self):\n    \"\"\"Default pickle library, can be overridden by runner implementation.\"\"\"\n    return None\n\n\n# FIXME: replace with PipelineState(str, enum.Enum)\nclass PipelineState(object):\n  \"\"\"State of the Pipeline, as returned by :attr:`PipelineResult.state`.\n","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/runner.py#L200-L236","documentation":"Within check_requirements(), if a transform has the TEST_STREAM primitive URN but the runner's supported_requirements does not include TestStream, a NotImplementedError with the URN itself is raised. TestStream requires explicit runner support for deterministic testing of watermark/timer behavior.","triggerScenarios":"A pipeline contains a TestStream transform (used in streaming tests) and is run with check_requirements against a runner that did not declare common_urns.primitives.TEST_STREAM.urn in supported_requirements.","commonSituations":"Running Beam streaming unit tests with TestStream on a runner that doesn't support it (e.g. certain portable/foreign-language runners); using TestStream in integration rather than unit test contexts.","solutions":["Run TestStream pipelines with a runner that supports TestStream (e.g. the FnApiRunner/test runner)","Add TEST_STREAM to the runner's supported_requirements if you own the runner and implement support","Replace TestStream with a regular test harness when runner support is unavailable"],"exampleFix":"// before\nwith beam.Pipeline(runner='FlinkRunner') as p:\n  _ = (p | TestStream().add_elements([...]))\n// after\nwith beam.Pipeline(runner='FnApiRunner') as p:\n  _ = (p | TestStream().add_elements([...]))","handlingStrategy":"try-catch","validationCode":"from apache_beam.coders import coder_impl\nfrom apache_beam.portability.api import beam_runner_api_pb2\nuses_test_stream = any(t.spec.urn == 'beam:transform:test_stream:v1'\n                       for t in pipeline_proto.components.transforms.values())","typeGuard":null,"tryCatchPattern":"try:\n    runner.check_requirements(pipeline_proto, runner.supported_requirements)\nexcept NotImplementedError as e:\n    if str(e) == 'beam:transform:test_stream:v1':\n        raise RuntimeError('Runner does not support TestStream; use FnApiRunner')","preventionTips":["Restrict TestStream usage to FnApiRunner-based tests","Gate TestStream pipelines behind runner capability checks","Do not run TestStream pipelines against production runners"],"tags":["apache-beam","test-stream","unsupported-feature","streaming"],"backgroundTag":"method-not-implemented","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"}