Merge partitions of vtkPartitionedDataSet?

I have a dataset that is a vtkPartitionedDataSet composed of vtkStructuredGrid partitions. I can read the file in ParaView, and there is a “Merge Blocks” filter available in the GUI that seems to convert vtkPartitionedDataSet to vtkUnstructuredGrid …

I looked at vtkMultiBlockMergeFilter, but that wasn’t able to operate on vtkPartitionedDataSet … what filter is ParaView using to merge the partitions?

Ok - looked at ParaView source. This is how I did it:

af = vtkAppendDataSets()
af.MergePointsOn()
for ind in range(partitioned_data.GetNumberOfPartitions()):
    af.AddInputData(partitioned_data.GetPartition(ind))
af.Update()

ug = af.GetOutputDataObject(0)