docs: def flush(self):
          """Flush changes to record."""
          files = self.dumps()
          # Do not create `_files` when there has not been `_files` field before
          # and the record still has no files attached.
          if files or '_files' in self.record:
              self.record['_files'] = files