GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: add bigframes default connection warning (#2471) · google/bigframes@f1bbba2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bigframes
    • bigquery/_operations
      • ai.py
    • functions
      • _function_session.py
    • operations
      • blob.py
    • session
      • __init__.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bigframes/bigquery/_operations/ai.py‎

Copy file name to clipboardExpand all lines: bigframes/bigquery/_operations/ai.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ def _convert_series(
10181018

10191019
def _resolve_connection_id(series: series.Series, connection_id: str | None):
10201020
return clients.get_canonical_bq_connection_id(
1021-
connection_id or series._session._bq_connection,
1021+
connection_id or series._session.bq_connection,
10221022
series._session._project,
10231023
series._session._location,
10241024
)
Collapse file

‎bigframes/functions/_function_session.py‎

Copy file name to clipboardExpand all lines: bigframes/functions/_function_session.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _resolve_bigquery_connection_id(
162162
) -> str:
163163
"""Resolves BigQuery connection id."""
164164
if not bigquery_connection:
165-
bigquery_connection = session._bq_connection # type: ignore
165+
bigquery_connection = session.bq_connection # type: ignore
166166

167167
bigquery_connection = clients.get_canonical_bq_connection_id(
168168
bigquery_connection,
Collapse file

‎bigframes/operations/blob.py‎

Copy file name to clipboardExpand all lines: bigframes/operations/blob.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def _resolve_connection(self, connection: Optional[str] = None) -> str:
311311
Raises:
312312
ValueError: If the connection cannot be resolved to a valid string.
313313
"""
314-
connection = connection or self._data._block.session._bq_connection
314+
connection = connection or self._data._block.session.bq_connection
315315
return clients.get_canonical_bq_connection_id(
316316
connection,
317317
default_project=self._data._block.session._project,
Collapse file

‎bigframes/session/__init__.py‎

Copy file name to clipboardExpand all lines: bigframes/session/__init__.py
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,16 @@ def _allows_ambiguity(self) -> bool:
374374
def _anonymous_dataset(self):
375375
return self._anon_dataset_manager.dataset
376376

377+
@property
378+
def bq_connection(self) -> str:
379+
msg = bfe.format_message(
380+
f"""You are using the BigFrames session default connection: {self._bq_connection},
381+
which can be different from the BigQuery project default connection.
382+
This default connection may change in the future."""
383+
)
384+
warnings.warn(msg, category=FutureWarning)
385+
return self._bq_connection
386+
377387
def __hash__(self):
378388
# Stable hash needed to use in expression tree
379389
return hash(str(self._session_id))
@@ -2253,7 +2263,7 @@ def _create_bq_connection(
22532263
) -> str:
22542264
"""Create the connection with the session settings and try to attach iam role to the connection SA.
22552265
If any of project, location or connection isn't specified, use the session defaults. Returns fully-qualified connection name."""
2256-
connection = self._bq_connection if not connection else connection
2266+
connection = self.bq_connection if not connection else connection
22572267
connection = bigframes.clients.get_canonical_bq_connection_id(
22582268
connection_id=connection,
22592269
default_project=self._project,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.