Skip to content

Commit f8bbdee

Browse files
linted
1 parent d6c534c commit f8bbdee

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/bigframes/bigframes/session/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def __init__(
324324
metrics=self._metrics,
325325
enable_polars_execution=context.enable_polars_execution,
326326
publisher=self._publisher,
327-
labels=labels,
327+
labels=tuple(labels.items()),
328328
)
329329

330330
def __del__(self):

packages/bigframes/bigframes/session/bq_caching_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def _execute_plan_gbq(
593593
peek: Optional[int] = None,
594594
cache_spec: Optional[ex_spec.CacheSpec] = None,
595595
must_create_table: bool = True,
596-
extra_labels: Mapping[str, str] = {},
596+
extra_labels: tuple[tuple[str, str], ...] = (),
597597
) -> executor.ExecuteResult:
598598
"""Just execute whatever plan as is, without further caching or decomposition."""
599599
# TODO(swast): plumb through the api_name of the user-facing api that

packages/bigframes/bigframes/session/proxy_executor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ def cached(
157157
correlation_id = f"{uuid.uuid1().hex[:12]}"
158158
try:
159159
return self._sqlglot_executor.cached(array_value, config=config)
160-
except google.cloud.exceptions.BadRequest as e:
160+
except Exception as e:
161161
msg = bfe.format_message(
162-
f"Compiler ID {correlation_id}: BadRequest on sqlglot. "
163-
f"Falling back to ibis. Details: {e.message}"
162+
f"Compiler ID {correlation_id}: Exception on sqlglot. "
163+
f"Falling back to ibis. Details: {e}"
164164
)
165165
warnings.warn(msg, category=UserWarning)
166166
return self._ibis_executor.cached(

packages/bigframes/tests/unit/session/test_proxy_executor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ def test_execute_stable_routes_to_sqlglot_fallback_to_ibis(mock_executor, monkey
112112
monkeypatch.setattr(bigframes.options.experiments, "sql_compiler", "stable")
113113
with mock.patch("uuid.uuid1") as mock_uuid:
114114
mock_uuid.return_value.hex = "1234567890123456"
115-
with pytest.warns(UserWarning, match="BadRequest on sqlglot"):
115+
with pytest.warns(
116+
UserWarning, match="Compiler ID 123456789012: Exception on sqlglot"
117+
):
116118
mock_executor.execute(array_value, execution_spec)
117119

118120
execution_spec.add_labels.assert_has_calls(

0 commit comments

Comments
 (0)