{"record":{"id":"7c9d6d98cafd7e85","repo":"apache/beam","slug":"unknown-access-pattern-s","errorCode":null,"errorMessage":"Unknown access_pattern: %s","messagePattern":"Unknown access_pattern: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/pvalue.py","lineNumber":430,"sourceCode":"    return False\n\n\nclass _UnpickledSideInput(AsSideInput):\n  def __init__(self, side_input_data: 'SideInputData') -> None:\n    self._data = side_input_data\n    self._window_mapping_fn = side_input_data.window_mapping_fn\n\n  @staticmethod\n  def _from_runtime_iterable(it, options):\n    access_pattern = options['data'].access_pattern\n    if access_pattern == common_urns.side_inputs.ITERABLE.urn:\n      raw_view = it\n    elif access_pattern == common_urns.side_inputs.MULTIMAP.urn:\n      raw_view = collections.defaultdict(list)\n      for k, v in it:\n        raw_view[k].append(v)\n    else:\n      raise ValueError('Unknown access_pattern: %s' % access_pattern)\n    return options['data'].view_fn(raw_view)\n\n  def _view_options(self):\n    return {\n        'data': self._data,  # For non-fn-api runners.\n        'window_mapping_fn': self._data.window_mapping_fn,\n        'coder': self._windowed_coder(),\n    }\n\n  def _side_input_data(self):\n    return self._data\n\n\nclass SideInputData(object):\n  \"\"\"All of the data about a side input except for the bound PCollection.\"\"\"\n  def __init__(\n      self,\n      access_pattern: str,","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/pvalue.py#L412-L448","documentation":"AsSideInput._from_runtime_iterable materializes a runtime iterable into the in-memory representation matching the side input's declared access pattern (SINGLETON or MULTIMAP). The library throws this ValueError when the access_pattern URN is neither, meaning the view options were constructed with an unrecognized or corrupted access pattern.","triggerScenarios":"Calling beam.pvalue.AsSideInput / AsMultimap / AsSingleton on a PCollection whose access_pattern urn is not common_urns.side_inputs.SINGLETON or MULTIMAP — e.g. a custom ViewFn passing a wrong urn, or runner-injected options with a typo'd/unsupported urn.","commonSituations":"Custom runner or custom view implementation supplying its own access_pattern; Beam version mismatch where a runner emits a side-input urn the Python SDK doesn't recognize; hand-built view_options in tests.","solutions":["Use only the provided side-input wrappers (AsSingleton, AsIter, AsDict, AsMultimap) instead of constructing AsSideInput/view options manually","Verify the access_pattern urn string exactly matches apache_beam.portability.common_urns.side_inputs.SINGLETON.urn or MULTIMAP.urn","Upgrade/downgrade the Python SDK so runner and SDK agree on side-input URNs","Check any custom ViewFn/Windowing for a copy-paste error in the urn it declares"],"exampleFix":"// before\nAsSideInput(pcoll, access_pattern='MULTIMAP ')  # trailing space\n// after\nfrom apache_beam.portability import common_urns\nAsSideInput(pcoll, access_pattern=common_urns.side_inputs.MULTIMAP.urn)","handlingStrategy":"validation","validationCode":"from apache_beam.portability import common_urns\nassert access_pattern in (common_urns.side_inputs.SINGLETON.urn, common_urns.side_inputs.MULTIMAP.urn), access_pattern","typeGuard":"def is_valid_access_pattern(urn): return urn in (common_urns.side_inputs.SINGLETON.urn, common_urns.side_inputs.MULTIMAP.urn)","tryCatchPattern":null,"preventionTips":["Only use built-in AsSingleton/AsIter/AsDict/AsMultimap wrappers","Keep SDK and runner versions aligned"],"tags":["python","apache-beam","side-input"],"backgroundTag":"invalid-enum-value","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"}