Skip to content

Conversation

@jialuoo
Copy link
Contributor

@jialuoo jialuoo commented Sep 26, 2025

The primary issue is the type recognition issue when a UDF uses a Series type hint, since the underlying serialization process converts the input series into a string.

Solutions implemented:

  1. Managed Functions: Solved by adding from __future__ import annotations, which enables the postponed evaluation of type annotations, preventing an eager runtime type error.

  2. Remote Functions: Solved by enforcing pandas.Series as the required input type hint. This is because the cloudpickle used in remote function can recognize pandas series since the later serialization is between string and pandas series, not bigframes series.

In general, this PR improves the robustness of bigframes functions and prevents a potential type error during serialization.

Fixes b/445182819 🦕

BEGIN_COMMIT_OVERRIDE
BREAKING CHANGE: argument type change.
Release-As: 2.25.0
END_COMMIT_OVERRIDE

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Sep 26, 2025
@jialuoo jialuoo requested a review from tswast September 29, 2025 22:48
@jialuoo jialuoo marked this pull request as ready for review September 29, 2025 22:49
@jialuoo jialuoo requested review from a team as code owners September 29, 2025 22:49
@jialuoo jialuoo requested a review from TrevorBergeron October 3, 2025 17:18
@jialuoo jialuoo requested a review from TrevorBergeron October 7, 2025 16:44
@jialuoo jialuoo enabled auto-merge (squash) October 7, 2025 18:25
@jialuoo jialuoo merged commit 8fc051f into main Oct 7, 2025
25 checks passed
@jialuoo jialuoo deleted the fix-series-input branch October 7, 2025 18:42
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: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants