Skip to content

fix: handle empty endpoints during cloud function reuse#17501

Merged
shuoweil merged 3 commits into
mainfrom
shuowei-disable-remote-function-test-temp
Jun 18, 2026
Merged

fix: handle empty endpoints during cloud function reuse#17501
shuoweil merged 3 commits into
mainfrom
shuowei-disable-remote-function-test-temp

Conversation

@shuoweil

@shuoweil shuoweil commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes an issue where reusing recently created Cloud Functions during Remote Function creation would sometimes result in an empty endpoint (endpoint="").

When a Cloud Function has been recently provisioned, its endpoint URI (response.service_config.uri) may occasionally be returned as an empty string if URL propagation is still pending. The remote function decorator previously only checked for None, proceeding to create the BigQuery Remote Function with OPTIONS(endpoint=''), which leads to validation failures when queries invoke the function.

This PR changes the check to if not cf_endpoint: to handle both None and empty strings. If the endpoint is empty, it will route to create_cloud_function, which catches the AlreadyExists exception and safely retries/waits for the endpoint URI propagation to complete.

Fixes #<525124882> 🦕

@shuoweil shuoweil requested review from TrevorBergeron and sycai June 17, 2026 22:01
@shuoweil shuoweil self-assigned this Jun 17, 2026
@shuoweil shuoweil requested review from a team as code owners June 17, 2026 22:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request skips the test_remote_function_connection_w_location system test due to a connection failure tracked under issue b/525124882. There are no review comments, and I have no feedback to provide.

@shuoweil shuoweil enabled auto-merge (squash) June 17, 2026 22:07
@shuoweil shuoweil added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 17, 2026
@shuoweil shuoweil disabled auto-merge June 17, 2026 22:33
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 17, 2026
@shuoweil shuoweil changed the title tests: skip test_remote_function_connection_w_location fix: handle empty endpoints during cloud function reuse Jun 17, 2026
@shuoweil shuoweil merged commit 4f5593a into main Jun 18, 2026
31 checks passed
@shuoweil shuoweil deleted the shuowei-disable-remote-function-test-temp branch June 18, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants