Thanks to visit codestin.com
Credit goes to github.com

Skip to content
14 changes: 14 additions & 0 deletions bigframes/_config/bigquery_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import annotations

from typing import Optional
import warnings

import google.api_core.exceptions
import google.auth.credentials
Expand Down Expand Up @@ -123,6 +124,11 @@ def bq_connection(self, value: Optional[str]):
def use_regional_endpoints(self) -> bool:
"""Flag to connect to regional API endpoints.

.. deprecated:: 0.13.0
BigQuery regional endpoints is a feature in preview and
available only to selected projects.
Enable it only if your project has regional endpoints access.

Requires ``location`` to also be set. For example, set
``location='asia-northeast1'`` and ``use_regional_endpoints=True`` to
connect to asia-northeast1-bigquery.googleapis.com.
Expand All @@ -135,4 +141,12 @@ def use_regional_endpoints(self, value: bool):
raise ValueError(
SESSION_STARTED_MESSAGE.format(attribute="use_regional_endpoints")
)

if value:
warnings.warn(
"BigQuery regional endpoints is a feature in preview and "
"available only to selected projects. "
"Enable it only if your project has regional endpoints access."
)

self._use_regional_endpoints = value