Skip to content

bigframes: Series.struct.field("full_response") on bbq.ai.generate_* results raises KeyError — struct field misspelled as full_resposne in vendored ibis AI ops #17708

Description

@nadia-polikarpova

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

Context

The vendored-ibis operation definitions for the AI.GENERATE_* functions
misspell the full_response struct field as full_resposne:

packages/bigframes/third_party/bigframes_vendored/ibis/expr/operations/ai_ops.py

  • line 42 (AIGenerate): pa.field("full_resposne", pa.string())
  • line 65 (AIGenerateBool): ("full_resposne", dt.string)
  • line 84 (AIGenerateInt): ("full_resposne", dt.string)
  • line 105 (AIGenerateDouble): ("full_resposne", dt.string)

The public-facing dtype in bigframes/operations/ai_ops.py spells the field
correctly (pa.field("full_response", dtypes.JSON_ARROW_TYPE)), and the
AI.GENERATE_* SQL functions themselves return a field named full_response.
Because of this mismatch, .struct.field("full_response") succeeds at plan
time (validated against the correctly-spelled bigframes dtype) but raises
KeyError: 'full_response' when the expression is compiled by the default
(ibis) compiler — i.e. on .to_pandas(), .cache(), etc.

.struct.explode() fails the same way, since it iterates the
correctly-spelled field names from the pandas dtype and calls
.field(name) for each.

Note the vendored dtype also declares the field as dt.string, while the
bigframes-level dtype says JSON — fixing the spelling may surface that
secondary inconsistency.

Expected Behavior:

response.struct.field("full_response") returns the full model response
JSON, as documented in the generate_bool/generate_double docstrings
(whose doctest output shows the struct containing full_response).

Actual Behavior:

response.struct.field("full_response") raises KeyError: 'full_response'

API client name and version

bigrames 2.36.0 (still present on main (2.45.0) as of 2026-07-14)

Reproduction steps: code

import bigframes.pandas as bpd
import bigframes.bigquery as bbq

df = bpd.DataFrame({"text": ["the sky is blue"]})
response = bbq.ai.generate_bool(
(df["text"], " — is this statement about nature?"),
connection_id="..",
endpoint="gemini-2.5-flash-lite",
)

response.struct.field("result").to_pandas() # works
response.struct.field("full_response").to_pandas() # KeyError: 'full_response'

Reproduction steps: supporting files

No response

Reproduction steps: actual results

KeyError: 'full_response'

Reproduction steps: expected results

full model response JSON

OS & version + platform

No response

Python environment

No response

Python dependencies

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions