{"record":{"id":"743d0f33361a3549","repo":"apache/beam","slug":"placement-id-must-be-specified","errorCode":null,"errorMessage":"placement_id must be specified","messagePattern":"placement_id must be specified","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/gcp/recommendations_ai.py","lineNumber":539,"sourceCode":"            metadata: Optional. Strings which\n              should be sent along with the request as metadata.\n            catalog_name (str): Optional. Name of the catalog.\n              Default: 'default_catalog'\n            event_store (str): Optional. Name of the event store.\n              Default: 'default_event_store'\n            placement_id (str): Required. ID of the recommendation engine\n              placement. This id is used to identify the set of models that\n              will be used to make the prediction.\n        \"\"\"\n    self.project = project\n    self.retry = retry\n    self.timeout = timeout\n    self.metadata = metadata\n    self.placement_id = placement_id\n    self.catalog_name = catalog_name\n    self.event_store = event_store\n    if placement_id is None:\n      raise ValueError('placement_id must be specified')\n    else:\n      self.placement_id = placement_id\n\n  def expand(self, pcoll):\n    if self.project is None:\n      self.project = pcoll.pipeline.options.view_as(GoogleCloudOptions).project\n    if self.project is None:\n      raise ValueError(\n          'GCP project name needs to be specified in \"project\" pipeline option')\n    return pcoll | ParDo(\n        _PredictUserEventFn(\n            self.project,\n            self.retry,\n            self.timeout,\n            self.metadata,\n            self.catalog_name,\n            self.event_store,\n            self.placement_id))","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/gcp/recommendations_ai.py#L521-L557","documentation":"Constructor guard for the Recommendations AI prediction transform: placement_id is required because it selects the set of models (the 'placement') that will serve predictions, and no sensible default exists for it.","triggerScenarios":"Thrown at sdks/python/apache_beam/ml/gcp/recommendations_ai.py:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply the placement_id argument, e.g. placement_id='recently_viewed'","Find valid placement IDs in the Recommendations AI console under your engine's placements"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}