code: def finalize(self, ctx, shard_state):
      
      filenames = []
      for filehandle in self._filehandles:
        filenames.append(filehandle.name)
        filehandle.close()
      shard_state.writer_state = {"shard_filenames": filenames}
docs: See parent class.