File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 17
17
from __future__ import annotations
18
18
19
19
from typing import Optional
20
+ import warnings
20
21
21
22
import google .api_core .exceptions
22
23
import google .auth .credentials
@@ -123,6 +124,11 @@ def bq_connection(self, value: Optional[str]):
123
124
def use_regional_endpoints (self ) -> bool :
124
125
"""Flag to connect to regional API endpoints.
125
126
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
+
126
132
Requires ``location`` to also be set. For example, set
127
133
``location='asia-northeast1'`` and ``use_regional_endpoints=True`` to
128
134
connect to asia-northeast1-bigquery.googleapis.com.
@@ -135,4 +141,12 @@ def use_regional_endpoints(self, value: bool):
135
141
raise ValueError (
136
142
SESSION_STARTED_MESSAGE .format (attribute = "use_regional_endpoints" )
137
143
)
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
+
138
152
self ._use_regional_endpoints = value
You can’t perform that action at this time.
0 commit comments