docs: def flush(self):
          """
          Ensure all remaining buffers are written.
          """
          for key in self.grouping_info.keys():
              if self._should_flush(key):
                  self._write_current_buffer_for_group_key(key)