Skip to content

Conversation

sycai
Copy link
Contributor

@sycai sycai commented Oct 5, 2025

b/446974666

I decided to create a local parser for transforming SQL type strings to PyArrow types. The code turned out to be not too difficult to write.

Plus, both the BigFrames and Ibis operators can deduct dtypes locally.

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Oct 5, 2025
@sycai sycai changed the title feat: add output_schema to ai.generate() feat: add output_schema parameter to ai.generate() Oct 5, 2025
@sycai sycai marked this pull request as ready for review October 6, 2025 16:51
@sycai sycai requested review from a team as code owners October 6, 2025 16:51
@pytest.mark.parametrize(
("sql", "expected"),
[
("x INT64", (pa.field("x", pa.int64()),)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support lowercase dtype strings (e.g., "int64") for compatibility with pandas APIs like astype()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Updated the parser to check the type strings in the case-insensitive way.

@sycai sycai requested a review from chelsea-lin October 6, 2025 17:43
@sycai sycai force-pushed the sycai_ai_generate_output_schema branch from 638037f to 780ff9f Compare October 7, 2025 19:47
@sycai sycai merged commit ef0b0b7 into main Oct 7, 2025
18 of 25 checks passed
@sycai sycai deleted the sycai_ai_generate_output_schema branch October 7, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants