diff --git a/pandas/core/apply.py b/pandas/core/apply.py index 28ca8b70c9d27..291ad2b071665 100644 --- a/pandas/core/apply.py +++ b/pandas/core/apply.py @@ -370,6 +370,8 @@ def agg_list_like(self) -> DataFrame | Series: # Capture and suppress any warnings emitted by us in the call # to agg below, but pass through any warnings that were # generated otherwise. + # This is necessary because of https://bugs.python.org/issue29672 + # See GH #43741 for more details with warnings.catch_warnings(record=True) as record: new_res = colg.aggregate(arg) if len(record) > 0: