Files
qdrant/lib/edge/python/src/update.rs
2025-10-19 19:06:13 +02:00

26 lines
708 B
Rust

use derive_more::Into;
use pyo3::prelude::*;
use shard::operations::point_ops::*;
use shard::operations::{CollectionUpdateOperations, point_ops};
use crate::*;
#[pyclass(name = "UpdateOperation")]
#[derive(Clone, Debug, Into)]
pub struct PyUpdateOperation(CollectionUpdateOperations);
#[pymethods]
impl PyUpdateOperation {
#[staticmethod]
pub fn upsert_points(points: Vec<PyPoint>) -> Self {
let points = points.into_iter().map(Into::into).collect();
let operation =
CollectionUpdateOperations::PointOperation(point_ops::PointOperations::UpsertPoints(
PointInsertOperationsInternal::PointsList(points),
));
Self(operation)
}
}