{"record":{"id":"a7ceb7871a1e8cb9","repo":"apache/beam","slug":"please-specify-a-bigquery-table-to-read-from","errorCode":null,"errorMessage":"Please specify a BigQuery table to read from.","messagePattern":"Please specify a BigQuery table to read from\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/dataframe/io.py","lineNumber":80,"sourceCode":"    table, dataset=None, project_id=None, use_bqstorage_api=False, **kwargs):\n  \"\"\"This function reads data from a BigQuery table and produces a\n  :class:`~apache_beam.dataframe.frames.DeferredDataFrame.\n\n  Args:\n    table (str): Please specify a table. This can be done in the format\n      'PROJECT:dataset.table' if one would not wish to utilize\n      the parameters below.\n    dataset (str): Please specify the dataset\n      (can omit if table was specified as 'PROJECT:dataset.table').\n    project_id (str): Please specify the project ID\n      (can omit if table was specified as 'PROJECT:dataset.table').\n    use_bqstorage_api (bool): If you would like to utilize\n      the BigQuery Storage API in ReadFromBigQuery, please set\n      this flag to true. Otherwise, please set flag\n      to false or leave it unspecified.\n      \"\"\"\n  if table is None:\n    raise ValueError(\"Please specify a BigQuery table to read from.\")\n  elif len(kwargs) > 0:\n    raise ValueError(\n        f\"Encountered unsupported parameter(s) in read_gbq: {kwargs.keys()!r}\"\n        \"\")\n  return _ReadGbq(table, dataset, project_id, use_bqstorage_api)\n\n\n@frame_base.with_docs_from(pd)\ndef read_csv(path, *args, splittable=False, binary=True, **kwargs):\n  \"\"\"If your files are large and records do not contain quoted newlines, you may\n  pass the extra argument ``splittable=True`` to enable dynamic splitting for\n  this read on newlines. Using this option for records that do contain quoted\n  newlines may result in partial records and data corruption.\"\"\"\n  if 'nrows' in kwargs:\n    raise ValueError('nrows not yet supported')\n  filename_column = kwargs.pop('filename_column', None)\n  return _ReadFromPandas(\n      pd.read_csv,","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/dataframe/io.py#L62-L98","documentation":"Validation guard in the Beam DataFrame API's read_gbq: table is a required argument, and when it is None this ValueError fires before any BigQuery read is configured. The function cannot construct a _ReadGbq source without a table (given directly or via 'PROJECT:dataset.table').","triggerScenarios":"Calling beam.dataframe.io.read_gbq(table=None) or omitting the table argument entirely.","commonSituations":"Building the table name from config/environment variables that are unset; refactoring code that moved the table id into a variable left empty.","solutions":["Pass the table explicitly, e.g. read_gbq('mydataset.mytable', project_id='my-project').","If the table comes from config, assert it is non-None before constructing the pipeline.","Check environment variables / flags supplying the table name are set."],"exampleFix":"// before\nread_gbq(table=os.environ.get('BQ_TABLE'), project_id='p')\n// after\ntable = os.environ['BQ_TABLE']\nassert table, 'BQ_TABLE must be set'\nread_gbq(table=table, project_id='p')","handlingStrategy":"validation","validationCode":"if not table:\n    raise ValueError('read_gbq: table is required')\nread_gbq(table=table, project_id=project)","typeGuard":null,"tryCatchPattern":"try:\n    df = read_gbq(table=table, project_id=project)\nexcept ValueError as e:\n    logging.error('Misconfigured BQ read: %s', e)\n    raise","preventionTips":["Fail fast on missing table config at pipeline startup","Use required environment variables, not optional .get()","Keep table identifiers in one config module"],"tags":["python","apache-beam","bigquery","io"],"backgroundTag":"missing-required-argument","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"}