Skip to content

Commit c467fda

Browse files
committed
fix: enable describe() count for Struct types and complex types
1 parent a634e97 commit c467fda

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

bigframes/pandas/core/methods/describe.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _describe(
100100

101101

102102
def _get_aggs_for_dtype(dtype) -> list[aggregations.UnaryAggregateOp]:
103-
if dtype in dtypes.NUMERIC_BIGFRAMES_TYPES_RESTRICTIVE:
103+
if dtypes.is_numeric(dtype, include_bool=False):
104104
return [
105105
aggregations.count_op,
106106
aggregations.mean_op,
@@ -111,14 +111,13 @@ def _get_aggs_for_dtype(dtype) -> list[aggregations.UnaryAggregateOp]:
111111
aggregations.ApproxQuartilesOp(3),
112112
aggregations.max_op,
113113
]
114-
elif dtype in dtypes.TEMPORAL_NUMERIC_BIGFRAMES_TYPES:
114+
elif dtypes.is_datetime_like(dtype) or dtypes.is_date_like(dtype):
115115
return [aggregations.count_op]
116-
elif dtype in [
117-
dtypes.STRING_DTYPE,
118-
dtypes.BOOL_DTYPE,
119-
dtypes.BYTES_DTYPE,
120-
dtypes.TIME_DTYPE,
121-
]:
116+
elif (
117+
dtypes.is_string_like(dtype)
118+
or dtypes.is_binary_like(dtype)
119+
or dtypes.is_time_like(dtype)
120+
):
122121
return [aggregations.count_op, aggregations.nunique_op]
123122
else:
124-
return []
123+
return [aggregations.count_op]

0 commit comments

Comments
 (0)