Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
Prev Previous commit
Next Next commit
Apply suggestions from code review
  • Loading branch information
tswast authored Jun 26, 2024
commit d3d6b091929079daa9ef38bab0563e31fac1873a
2 changes: 1 addition & 1 deletion bigframes/core/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ def aggregate_all_and_stack(
]
# TODO: may need add NullaryAggregation in main_aggregation
# when agg add support for axis=1, needed for agg("size", axis=1)
assert isinstance(operation, agg_ops.UnaryAggregateOp)
assert isinstance(operation, agg_ops.UnaryAggregateOp), f"Expected a unary operation, but got {operation}. Please report this error and how you got here to the BigQuery DataFrames team (bit.ly/bigframes-feedback)."
main_aggregation = (
ex.UnaryAggregation(operation, ex.free_var(value_col_id)),
value_col_id,
Expand Down
6 changes: 4 additions & 2 deletions bigframes/operations/aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ def output_type(self, *input_types: dtypes.ExpressionType) -> dtypes.ExpressionT


# TODO: Alternative names and lookup from numpy function objects
# Add size_op separately to avoid Mypy type inference errors.
_AGGREGATIONS_LOOKUP: typing.Dict[
str, typing.Union[UnaryAggregateOp, NullaryAggregateOp]
] = {
Expand All @@ -509,7 +508,10 @@ def output_type(self, *input_types: dtypes.ExpressionType) -> dtypes.ExpressionT
ApproxQuartilesOp(2),
ApproxQuartilesOp(3),
]
+ [size_op]
+ [
# Add size_op separately to avoid Mypy type inference errors.
size_op,
]
}


Expand Down