{"record":{"id":"440bdf7729b7d490","repo":"apache/beam","slug":"project-must-be-specified-either-in","errorCode":null,"errorMessage":"project must be specified either in ReadBigQueryChangeHistory or in pipeline options (--project)","messagePattern":"project must be specified either in ReadBigQueryChangeHistory or in pipeline options \\(--project\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/gcp/bigquery_change_history.py","lineNumber":1246,"sourceCode":"    self._project = project\n    self._temp_dataset = temp_dataset\n    self._location = location\n    self._change_type_column = change_type_column\n    self._change_timestamp_column = change_timestamp_column\n    self._columns = columns\n    self._row_filter = row_filter\n    self._batch_arrow_read = batch_arrow_read\n    self._max_split_rounds = max_split_rounds\n    self._reshuffle_decompress = reshuffle_decompress\n\n  def expand(self, pbegin: beam.pvalue.PBegin) -> beam.PCollection:\n    project = self._project\n    if project is None:\n      project = pbegin.pipeline.options.view_as(\n          beam.options.pipeline_options.GoogleCloudOptions).project\n\n    if project is None:\n      raise ValueError(\n          'project must be specified either in ReadBigQueryChangeHistory '\n          'or in pipeline options (--project)')\n\n    start_time = Timestamp(self._start_time or time.time())\n    stop_time = (\n        Timestamp(self._stop_time)\n        if self._stop_time is not None else MAX_TIMESTAMP)\n    buffer = Duration(seconds=self._buffer_sec)\n    poll_interval = Duration(seconds=self._poll_interval_sec)\n\n    temp_dataset = self._temp_dataset\n    if temp_dataset is None:\n      temp_dataset = f'beam_ch_temp_{uuid.uuid4().hex[:12]}'\n\n    _LOGGER.info(\n        '[ReadBigQueryChangeHistory] expand: table=%s, project=%s, '\n        'change_function=%s, poll_interval=%d sec, buffer=%d sec, '\n        'temp_dataset=%s, start_time=%s, stop_time=%s',","sourceCodeStart":1228,"sourceCodeEnd":1264,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/gcp/bigquery_change_history.py#L1228-L1264","documentation":"ReadBigQueryChangeHistory needs a GCP project ID to call the BigQuery change history API. It first takes the project passed to its constructor; if None, it falls back to --project in GoogleCloudOptions. If both are absent, it raises this ValueError because the API call cannot be scoped to a project.","triggerScenarios":"Constructing ReadBigQueryChangeHistory with project=None (or omitted) and launching the pipeline without the --project flag in GoogleCloudOptions.","commonSituations":"Running a pipeline on a machine with no gcloud default project configured, using a Dataflow template without the project parameter, or constructing the transform programmatically and forgetting to set GoogleCloudOptions.project.","solutions":["Pass project='my-project' to the ReadBigQueryChangeHistory constructor.","Set --project (GoogleCloudOptions.project) in your PipelineOptions when creating the pipeline.","Set the default project via 'gcloud config set project my-project' or the GOOGLE_CLOUD_PROJECT environment variable so options resolution picks it up."],"exampleFix":"// before\nbeam.io.gcp.bigquery_change_history.ReadBigQueryChangeHistory(query='SELECT 1')\n// after\nbeam.io.gcp.bigquery_change_history.ReadBigQueryChangeHistory(query='SELECT 1', project='my-gcp-project')","handlingStrategy":"validation","validationCode":"opts = pipeline.options.view_as(beam.options.pipeline_options.GoogleCloudOptions)\nif transform._project is None and not opts.project:\n    raise ValueError('Set project on ReadBigQueryChangeHistory or via --project')","typeGuard":"def has_project(t) -> bool:\n    return bool(getattr(t, '_project', None))","tryCatchPattern":null,"preventionTips":["Always set GoogleCloudOptions.project explicitly in PipelineOptions","Never rely on ambient gcloud defaults in production pipelines","Validate required options at pipeline-construction time"],"tags":["gcp","bigquery","configuration","beam"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}