{"record":{"id":"abed6327c5cfcc6d","repo":"apache/beam","slug":"encountered-unsupported-parameter-s-in-read-gbq-kwargs-keys","errorCode":null,"errorMessage":"Encountered unsupported parameter(s) in read_gbq: {kwargs.keys()!r}","messagePattern":"Encountered unsupported parameter\\(s\\) in read_gbq: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/dataframe/io.py","lineNumber":82,"sourceCode":"  :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,\n      path,\n      args,","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/dataframe/io.py#L64-L100","documentation":"read_gbq in the Beam DataFrame API accepts only its documented parameters (table, dataset, project_id, use_bqstorage_api). Any extra keyword arguments — e.g. pandas-style options — trigger this ValueError listing the unsupported keys, since the deferred BigQuery reader implements only a subset of the pandas-gbq signature.","triggerScenarios":"Calling read_gbq(table=..., query=...), read_gbq(..., location='EU'), or passing pandas-gbq style options (reauth, dialect, credentials) that the Beam connector does not accept.","commonSituations":"Migrating code from pandas.read_gbq or google-cloud-bigquery to Beam's read_gbq and keeping old kwargs; typos in parameter names (e.g. projectid vs project_id).","solutions":["Remove all kwargs except table, dataset, project_id, use_bqstorage_api from the call.","If you need SQL-level querying or advanced options, use apache_beam.io.gcp.bigquery.ReadFromBigQuery instead.","Check parameter spelling against the read_gbq signature in sdks/python/apache_beam/dataframe/io.py."],"exampleFix":"// before\nread_gbq(table='t', dataset='d', query='SELECT 1')\n// after\nread_gbq(table='t', dataset='d')  # or ReadFromBigQuery(query='SELECT 1')","handlingStrategy":"validation","validationCode":"ALLOWED = {'table', 'dataset', 'project_id', 'use_bqstorage_api'}\nextra = set(kwargs) - ALLOWED\nif extra:\n    raise ValueError(f'Unsupported read_gbq kwargs: {extra}')","typeGuard":null,"tryCatchPattern":"try:\n    df = read_gbq(**opts)\nexcept ValueError:\n    opts = {k: v for k, v in opts.items() if k in ALLOWED}\n    df = read_gbq(**opts)","preventionTips":["Only pass the four supported parameters to read_gbq","Use ReadFromBigQuery for advanced options","Lint wrappers that forward **kwargs blindly"],"tags":["python","apache-beam","bigquery","api"],"backgroundTag":"invalid-argument-value","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"}