Files
qdrant/lib/edge/python/src/count.rs
dependabot[bot] ac7e9f905c build(deps): bump pyo3 from 0.27.2 to 0.28.0 (#8034)
* build(deps): bump pyo3 from 0.27.2 to 0.28.0

Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.27.2 to 0.28.0.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.27.2...v0.28.0)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: add skip_from_py_object to accept the new behaviour

* chore: switch to from_py_object

* chore: allow deprecated usage

* fix: import

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Boros <dancixx@gmail.com>
2026-02-04 10:10:00 +01:00

36 lines
833 B
Rust

use bytemuck::TransparentWrapper as _;
use derive_more::Into;
use pyo3::prelude::*;
use segment::types::Filter;
use shard::count::CountRequestInternal;
use crate::repr::*;
use crate::types::PyFilter;
#[pyclass(name = "CountRequest", from_py_object)]
#[derive(Clone, Debug, Into)]
pub struct PyCountRequest(CountRequestInternal);
#[pyclass_repr]
#[pymethods]
impl PyCountRequest {
#[new]
#[pyo3(signature = (exact = true, filter = None))]
pub fn new(exact: bool, filter: Option<PyFilter>) -> Self {
Self(CountRequestInternal {
filter: filter.map(Filter::from),
exact,
})
}
#[getter]
pub fn filter(&self) -> Option<&PyFilter> {
self.0.filter.as_ref().map(PyFilter::wrap_ref)
}
#[getter]
pub fn exact(&self) -> bool {
self.0.exact
}
}