Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate use_regional_endpoints #199

Merged
merged 9 commits into from
Dec 13, 2023
12 changes: 12 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,10 @@ def bq_connection(self, value: Optional[str]):
def use_regional_endpoints(self) -> bool:
"""Flag to connect to regional API endpoints.

.. deprecated:: 0.13.0
shobsi marked this conversation as resolved.
Show resolved Hide resolved
BigQuery regional endpoints is locked to allowlisted 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 +140,11 @@ 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 locked to allowlisted projects. "
"Enable it only if your project has regional endpoints access."
shobsi marked this conversation as resolved.
Show resolved Hide resolved
)

self._use_regional_endpoints = value
1 change: 0 additions & 1 deletion tests/system/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def session() -> bigframes.Session:
def session_tokyo(tokyo_location: str) -> bigframes.Session:
context = bigframes.BigQueryOptions(
location=tokyo_location,
use_regional_endpoints=True,
)
return bigframes.Session(context=context)

Expand Down