apache/beam · error · ValueError
Please specify a BigQuery table to read from.
Error message
Please specify a BigQuery table to read from.
What it means
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').
Source
Thrown at sdks/python/apache_beam/dataframe/io.py:80
table, dataset=None, project_id=None, use_bqstorage_api=False, **kwargs):
"""This function reads data from a BigQuery table and produces a
:class:`~apache_beam.dataframe.frames.DeferredDataFrame.
Args:
table (str): Please specify a table. This can be done in the format
'PROJECT:dataset.table' if one would not wish to utilize
the parameters below.
dataset (str): Please specify the dataset
(can omit if table was specified as 'PROJECT:dataset.table').
project_id (str): Please specify the project ID
(can omit if table was specified as 'PROJECT:dataset.table').
use_bqstorage_api (bool): If you would like to utilize
the BigQuery Storage API in ReadFromBigQuery, please set
this flag to true. Otherwise, please set flag
to false or leave it unspecified.
"""
if table is None:
raise ValueError("Please specify a BigQuery table to read from.")
elif len(kwargs) > 0:
raise ValueError(
f"Encountered unsupported parameter(s) in read_gbq: {kwargs.keys()!r}"
"")
return _ReadGbq(table, dataset, project_id, use_bqstorage_api)
@frame_base.with_docs_from(pd)
def read_csv(path, *args, splittable=False, binary=True, **kwargs):
"""If your files are large and records do not contain quoted newlines, you may
pass the extra argument ``splittable=True`` to enable dynamic splitting for
this read on newlines. Using this option for records that do contain quoted
newlines may result in partial records and data corruption."""
if 'nrows' in kwargs:
raise ValueError('nrows not yet supported')
filename_column = kwargs.pop('filename_column', None)
return _ReadFromPandas(
pd.read_csv,View on GitHub (pinned to 12126d8942)
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.
Example fix
// before
read_gbq(table=os.environ.get('BQ_TABLE'), project_id='p')
// after
table = os.environ['BQ_TABLE']
assert table, 'BQ_TABLE must be set'
read_gbq(table=table, project_id='p') Defensive patterns
Strategy: validation
Validate before calling
if not table:
raise ValueError('read_gbq: table is required')
read_gbq(table=table, project_id=project) Try / catch
try:
df = read_gbq(table=table, project_id=project)
except ValueError as e:
logging.error('Misconfigured BQ read: %s', e)
raise Prevention
- Fail fast on missing table config at pipeline startup
- Use required environment variables, not optional .get()
- Keep table identifiers in one config module
When it happens
Trigger: Calling beam.dataframe.io.read_gbq(table=None) or omitting the table argument entirely.
Common situations: Building the table name from config/environment variables that are unset; refactoring code that moved the table id into a variable left empty.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Encountered an Atomic type that is not currently supported b
- Encountered unsupported parameter(s) in read_gbq: {kwargs.ke
- nrows not yet supported
- Found no files that match {self.path!r}
- Cannot call read after iterating.
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/a7ceb7871a1e8cb9.
Report an issue: GitHub.