diff --git a/marimo/_plugins/ui/_impl/dataframes/transforms/apply.py b/marimo/_plugins/ui/_impl/dataframes/transforms/apply.py index ca469c6f909..a6341f3a1b1 100644 --- a/marimo/_plugins/ui/_impl/dataframes/transforms/apply.py +++ b/marimo/_plugins/ui/_impl/dataframes/transforms/apply.py @@ -143,11 +143,11 @@ def _is_superset(self, transforms: Transformations) -> bool: if len(self._transforms) > len(transforms.transforms): return False - for i, transform in enumerate(self._transforms): - if transform != transforms.transforms[i]: - return False + # Fast path: check if the two lists are identical up to self._transforms + if self._transforms == transforms.transforms[: len(self._transforms)]: + return True - return True + return False def _get_next_transformations( self, transforms: Transformations