{"record":{"id":"827afd275d55650b","repo":"apache/beam","slug":"pyarrow-is-required-for-readbigquerychangehistory-install-it","errorCode":null,"errorMessage":"pyarrow is required for ReadBigQueryChangeHistory. Install it with: pip install pyarrow","messagePattern":"pyarrow is required for ReadBigQueryChangeHistory\\. Install it with: pip install pyarrow","errorType":"validation","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/gcp/bigquery_change_history.py","lineNumber":1210,"sourceCode":"      buffer_sec: float = 10,\n      project: Optional[str] = None,\n      temp_dataset: Optional[str] = None,\n      location: Optional[str] = None,\n      change_type_column: str = 'change_type',\n      change_timestamp_column: str = 'change_timestamp',\n      columns: Optional[list[str]] = None,\n      row_filter: Optional[str] = None,\n      batch_arrow_read: bool = True,\n      max_split_rounds: int = 1,\n      reshuffle_decompress: bool = True) -> None:\n    super().__init__()\n    if bq_storage is None:\n      raise ImportError(\n          'google-cloud-bigquery-storage is required for '\n          'ReadBigQueryChangeHistory. Install it with: '\n          'pip install google-cloud-bigquery-storage')\n    if pyarrow is None:\n      raise ImportError(\n          'pyarrow is required for ReadBigQueryChangeHistory. '\n          'Install it with: pip install pyarrow')\n    if change_function not in ('CHANGES', 'APPENDS'):\n      raise ValueError(\n          f\"change_function must be 'CHANGES' or 'APPENDS', \"\n          f\"got '{change_function}'\")\n    if poll_interval_sec < 15:\n      raise ValueError(\n          f'poll_interval_sec must be >= 15, got {poll_interval_sec}')\n    if buffer_sec < 0:\n      raise ValueError(f'buffer_sec must be >= 0, got {buffer_sec}')\n    self._table = table\n    self._poll_interval_sec = poll_interval_sec\n    self._start_time = start_time\n    self._stop_time = stop_time\n    self._change_function = change_function\n    self._buffer_sec = buffer_sec\n    self._project = project","sourceCodeStart":1192,"sourceCodeEnd":1228,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/gcp/bigquery_change_history.py#L1192-L1228","documentation":"ReadBigQueryChangeHistory also requires pyarrow to decode arrow RecordBatches returned by the Storage Read API. If the module-level pyarrow import is None, __init__ raises ImportError with the pip install command, since the arrow-batch read path cannot run without it.","triggerScenarios":"Instantiating ReadFromBigQueryChangeHistory in an environment where pyarrow is not installed (pyarrow is None at import time), regardless of batch_arrow_read setting, because the transform validates both dependencies up front.","commonSituations":"Slim CI/deployment images without pyarrow; conflicting numpy/pyarrow wheels causing failed import; forgetting the gcp extras that pull in pyarrow.","solutions":["Run: pip install pyarrow","Install with GCP extras: pip install 'apache-beam[gcp]'","If the import fails due to binary incompatibility, reinstall a matching pyarrow/numpy pair: pip install --force-reinstall pyarrow numpy."],"exampleFix":"// before\npip install apache-beam\n// after\npip install 'apache-beam[gcp]'  # includes pyarrow","handlingStrategy":"fallback","validationCode":"try:\n    import pyarrow\nexcept ImportError:\n    raise SystemExit(\"pip install pyarrow\")","typeGuard":null,"tryCatchPattern":"try:\n    transform = ReadFromBigQueryChangeHistory(...)\nexcept ImportError as e:\n    log.error(\"install missing dependency: %s\", e)","preventionTips":["Add pyarrow to your requirements and pin a version compatible with your numpy","Use 'apache-beam[gcp]' which pulls pyarrow","If import fails due to binary conflicts, force-reinstall pyarrow and numpy together"],"tags":["python","apache-beam","bigquery","dependency","pyarrow"],"backgroundTag":"missing-optional-dependency","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"}