Repository: qdrant/qdrant
File: lib/collection/src/operations/generalizer/update_persisted.rs (Rust)

Code before:
        }
    }
}

impl Generalizer for PointOperations {
    fn remove_details(&self) -> Self {
        match self {
            PointOperations::UpsertPoints(upsert_operation) => {
                PointOperations::UpsertPoints(upsert_operation.remove_details())
            }
            PointOperations::UpsertPointsConditional(upsert_conditional_operation) => {
                PointOperations::UpsertPointsConditional(
                    upsert_conditional_operation.remove_details(),
                )
            }
            PointOperations::DeletePoints { ids } => {
                PointOperations::DeletePoints { ids: ids.clone() }
            }
            PointOperations::DeletePointsByFilter(filter) => {
                PointOperations::DeletePointsByFilter(filter.clone())
            }
            PointOperations::SyncPoints(sync_operation) => {
                PointOperations::SyncPoints(sync_operation.remove_details())
            }
            #[cfg(feature = "staging")]
            PointOperations::TestDelayUpsertPoints(op) => {
                PointOperations::TestDelayUpsertPoints(op.clone())
            }
        }
    }
}

impl Generalizer for PointSyncOperation {
    fn remove_details(&self) -> Self {
        let Self {
            from_id,
            to_id,
            points,
        } = self;

        Self {
            from_id: *from_id,
            to_id: *to_id,
            points: points.iter().map(|point| point.remove_details()).collect(),
        }
    }
}

impl Generalizer for PointStructPersisted {
    fn remove_details(&self) -> Self {
        let Self {

Review comment (suggestion):
This isn't strictly an upsert operation. I vote to change it from `TestDelayUpsertPoints` to `TestDelay`.

I think it'd be even better to move it one level up, into [`CollectionUpdateOperations`](https://github.com/qdrant/qdrant/blob/094aa5c19418cdad352196fb0f132ec8c64a2bce/lib/shard/src/operations/mod.rs#L15-L23). We can do that in a separate PR.

Code after:
        }
    }
}

impl Generalizer for PointOperations {
    fn remove_details(&self) -> Self {
        match self {
            PointOperations::UpsertPoints(upsert_operation) => {
                PointOperations::UpsertPoints(upsert_operation.remove_details())
            }
            PointOperations::UpsertPointsConditional(upsert_conditional_operation) => {
                PointOperations::UpsertPointsConditional(
                    upsert_conditional_operation.remove_details(),
                )
            }
            PointOperations::DeletePoints { ids } => {
                PointOperations::DeletePoints { ids: ids.clone() }
            }
            PointOperations::DeletePointsByFilter(filter) => {
                PointOperations::DeletePointsByFilter(filter.clone())
            }
            PointOperations::SyncPoints(sync_operation) => {
                PointOperations::SyncPoints(sync_operation.remove_details())
            }
            #[cfg(feature = "staging")]
            PointOperations::TestDelay(op) => PointOperations::TestDelay(op.clone()),
        }
    }
}

impl Generalizer for PointSyncOperation {
    fn remove_details(&self) -> Self {
        let Self {
            from_id,
            to_id,
            points,
        } = self;

        Self {
            from_id: *from_id,
            to_id: *to_id,
            points: points.iter().map(|point| point.remove_details()).collect(),
        }
    }
}

impl Generalizer for PointStructPersisted {
    fn remove_details(&self) -> Self {
        let Self {
            id: _, // ignore actual id for generalization
            vector,