Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit ab9d610

Browse files
committed
fix
1 parent ee94f71 commit ab9d610

File tree

6 files changed

+8
-12
lines changed

6 files changed

+8
-12
lines changed

bigframes/bigquery/_operations/ai.py

Lines 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
)

bigframes/core/blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def reset_index(
442442
level_ids = self.index_columns
443443

444444
expr = self._expr
445-
replacement_idx_type = replacement or self.session._default_index_type # type: ignore
445+
replacement_idx_type = replacement or self.session._default_index_type
446446
if set(self.index_columns) > set(level_ids):
447447
new_index_cols = [col for col in self.index_columns if col not in level_ids]
448448
new_index_labels = [self.col_id_to_index_name[id] for id in new_index_cols]
@@ -2382,7 +2382,7 @@ def merge(
23822382
if (
23832383
self.index.is_null
23842384
or other.index.is_null
2385-
or self.session._default_index_type == bigframes.enums.DefaultIndexKind.NULL # type: ignore
2385+
or self.session._default_index_type == bigframes.enums.DefaultIndexKind.NULL
23862386
):
23872387
return Block(joined_expr, index_columns=[], column_labels=labels)
23882388
elif index_cols:

bigframes/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4233,7 +4233,7 @@ def to_gbq(
42334233

42344234
# The client code owns this table reference now
42354235
temp_table_ref = (
4236-
self._session._anon_dataset_manager.generate_unique_resource_id() # type: ignore
4236+
self._session._anon_dataset_manager.generate_unique_resource_id()
42374237
)
42384238
destination_table = f"{temp_table_ref.project}.{temp_table_ref.dataset_id}.{temp_table_ref.table_id}"
42394239

bigframes/functions/_function_session.py

Lines 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,

bigframes/operations/blob.py

Lines 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,

bigframes/session/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def _anonymous_dataset(self):
375375
return self._anon_dataset_manager.dataset
376376

377377
@property
378-
def _bq_connection(self) -> str:
378+
def bq_connection(self) -> str:
379379
msg = bfe.format_message(
380380
f"""You are using the BigFrames session default connection: {self._bq_connection},
381381
which can be different from the BigQuery project default connection.
@@ -384,10 +384,6 @@ def _bq_connection(self) -> str:
384384
warnings.warn(msg, category=FutureWarning)
385385
return self._bq_connection
386386

387-
@_bq_connection.setter
388-
def _bq_connection(self, value):
389-
self._bq_connection = value
390-
391387
def __hash__(self):
392388
# Stable hash needed to use in expression tree
393389
return hash(str(self._session_id))
@@ -2267,7 +2263,7 @@ def _create_bq_connection(
22672263
) -> str:
22682264
"""Create the connection with the session settings and try to attach iam role to the connection SA.
22692265
If any of project, location or connection isn't specified, use the session defaults. Returns fully-qualified connection name."""
2270-
connection = self._bq_connection if not connection else connection
2266+
connection = self.bq_connection if not connection else connection
22712267
connection = bigframes.clients.get_canonical_bq_connection_id(
22722268
connection_id=connection,
22732269
default_project=self._project,

0 commit comments

Comments
 (0)