Skip to content

Commit 319a1f2

Browse files
shobsitswast
andauthored
chore: deprecate use_regional_endpoints (#199)
* chore: deprecate `use_regional_endpoints` * don't enable `use_regional_endpoints` in system tests * reword the regional endpoints deprecation message --------- Co-authored-by: Tim Swast <[email protected]>
1 parent 80b8bbe commit 319a1f2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

bigframes/_config/bigquery_options.py

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from __future__ import annotations
1818

1919
from typing import Optional
20+
import warnings
2021

2122
import google.api_core.exceptions
2223
import google.auth.credentials
@@ -123,6 +124,11 @@ def bq_connection(self, value: Optional[str]):
123124
def use_regional_endpoints(self) -> bool:
124125
"""Flag to connect to regional API endpoints.
125126
127+
.. deprecated:: 0.13.0
128+
BigQuery regional endpoints is a feature in preview and
129+
available only to selected projects.
130+
Enable it only if your project has regional endpoints access.
131+
126132
Requires ``location`` to also be set. For example, set
127133
``location='asia-northeast1'`` and ``use_regional_endpoints=True`` to
128134
connect to asia-northeast1-bigquery.googleapis.com.
@@ -135,4 +141,12 @@ def use_regional_endpoints(self, value: bool):
135141
raise ValueError(
136142
SESSION_STARTED_MESSAGE.format(attribute="use_regional_endpoints")
137143
)
144+
145+
if value:
146+
warnings.warn(
147+
"BigQuery regional endpoints is a feature in preview and "
148+
"available only to selected projects. "
149+
"Enable it only if your project has regional endpoints access."
150+
)
151+
138152
self._use_regional_endpoints = value

0 commit comments

Comments
 (0)