Skip to content

Commit 09193f2

Browse files
fix error type regression
1 parent c10983b commit 09193f2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

bigframes/core/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def resolve_label_exact_or_error(self, label: Label) -> str:
278278
raises an error. If there is no such a column, raises an error too."""
279279
col_id = self.resolve_label_exact(label)
280280
if col_id is None:
281-
raise KeyError(f"Label {label} not found. {constants.FEEDBACK_LINK}")
281+
raise ValueError(f"Label {label} not found. {constants.FEEDBACK_LINK}")
282282
return col_id
283283

284284
@functools.cached_property

bigframes/dataframe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3010,7 +3010,9 @@ def agg(
30103010
funcnames = []
30113011
for col_label, agg_func in func.items():
30123012
agg_func_list = agg_func if utils.is_list_like(agg_func) else [agg_func]
3013-
col_id = self._block.resolve_label_exact_or_error(col_label)
3013+
col_id = self._block.resolve_label_exact(col_label)
3014+
if col_id is None:
3015+
raise KeyError(f"Column {col_label} does not exist")
30143016
for agg_func in agg_func_list:
30153017
agg_op = agg_ops.lookup_agg_func(typing.cast(str, agg_func))
30163018
agg_expr = (

0 commit comments

Comments
 (0)