| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1018,7 +1018,7 @@ def _convert_series( | |||
| 1018 | 1018 | ||
| 1019 | 1019 | def _resolve_connection_id(series: series.Series, connection_id: str | None): | |
| 1020 | 1020 | return clients.get_canonical_bq_connection_id( | |
| 1021 | - connection_id or series._session._bq_connection, | ||
| 1021 | + connection_id or series._session.bq_connection, | ||
| 1022 | 1022 | series._session._project, | |
| 1023 | 1023 | series._session._location, | |
| 1024 | 1024 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,7 +162,7 @@ def _resolve_bigquery_connection_id( | |||
| 162 | 162 | ) -> str: | |
| 163 | 163 | """Resolves BigQuery connection id.""" | |
| 164 | 164 | if not bigquery_connection: | |
| 165 | - bigquery_connection = session._bq_connection # type: ignore | ||
| 165 | + bigquery_connection = session.bq_connection # type: ignore | ||
| 166 | 166 | ||
| 167 | 167 | bigquery_connection = clients.get_canonical_bq_connection_id( | |
| 168 | 168 | bigquery_connection, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -311,7 +311,7 @@ def _resolve_connection(self, connection: Optional[str] = None) -> str: | |||
| 311 | 311 | Raises: | |
| 312 | 312 | ValueError: If the connection cannot be resolved to a valid string. | |
| 313 | 313 | """ | |
| 314 | - connection = connection or self._data._block.session._bq_connection | ||
| 314 | + connection = connection or self._data._block.session.bq_connection | ||
| 315 | 315 | return clients.get_canonical_bq_connection_id( | |
| 316 | 316 | connection, | |
| 317 | 317 | default_project=self._data._block.session._project, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -374,6 +374,16 @@ def _allows_ambiguity(self) -> bool: | |||
| 374 | 374 | def _anonymous_dataset(self): | |
| 375 | 375 | return self._anon_dataset_manager.dataset | |
| 376 | 376 | ||
| 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 | + | ||
| 377 | 387 | def __hash__(self): | |
| 378 | 388 | # Stable hash needed to use in expression tree | |
| 379 | 389 | return hash(str(self._session_id)) | |
@@ -2253,7 +2263,7 @@ def _create_bq_connection( | |||
| 2253 | 2263 | ) -> str: | |
| 2254 | 2264 | """Create the connection with the session settings and try to attach iam role to the connection SA. | |
| 2255 | 2265 | 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 | ||
| 2257 | 2267 | connection = bigframes.clients.get_canonical_bq_connection_id( | |
| 2258 | 2268 | connection_id=connection, | |
| 2259 | 2269 | default_project=self._project, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments