Commit 4f5593a
authored
fix: handle empty endpoints during cloud function reuse (#17501)
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> 🦕1 parent 6f99e23 commit 4f5593a
1 file changed
Lines changed: 3 additions & 1 deletion
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
| |||
0 commit comments