Repository: qdrant/qdrant
File: lib/edge/python/src/query.rs (Rust)

Code before:
use segment::data_types::vectors::{DEFAULT_VECTOR_NAME, VectorInternal};
use segment::index::query_optimization::rescore_formula::parsed_formula::ParsedFormula;
use segment::json_path::JsonPath;
use shard::query::query_enum::QueryEnum;
use shard::query::*;
use shard::scroll::OrderByInterface;

use super::*;
use crate::repr::*;

#[pyclass(name = "QueryRequest")]
#[derive(Clone, Debug, Into)]
pub struct PyQueryRequest(ShardQueryRequest);

#[pyclass_repr]
#[pymethods]
impl PyQueryRequest {
    #[new]
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        prefetches: Vec<PyPrefetch>,
        query: Option<PyScoringQuery>,
        filter: Option<PyFilter>,
        score_threshold: Option<f32>,
        limit: usize,
        offset: usize,
        params: Option<PySearchParams>,
        with_vector: PyWithVector,
        with_payload: PyWithPayload,
    ) -> Self {
        Self(ShardQueryRequest {
            prefetches: PyPrefetch::peel_vec(prefetches),
            query: query.map(ScoringQuery::from),
            filter: filter.map(Filter::from),
            score_threshold: score_threshold.map(OrderedFloat),
            limit,
            offset,
            params: params.map(SearchParams::from),
            with_vector: WithVector::from(with_vector),
            with_payload: WithPayloadInterface::from(with_payload),
        })
    }

    #[getter]
    pub fn prefetches(&self) -> &[PyPrefetch] {
        PyPrefetch::wrap_slice(&self.0.prefetches)
    }

    #[getter]
    pub fn query(&self) -> Option<&PyScoringQuery> {
        self.0.query.as_ref().map(PyScoringQuery::wrap_ref)

Review comment (suggestion):
`filter` before `with_vector`/`with_payload`?
```suggestion
        prefetches = None,
        filter = None,
        with_vector = None,
        with_payload = None,
```

Code after:
use segment::data_types::vectors::{DEFAULT_VECTOR_NAME, VectorInternal};
use segment::index::query_optimization::rescore_formula::parsed_formula::ParsedFormula;
use segment::json_path::JsonPath;
use shard::query::query_enum::QueryEnum;
use shard::query::*;
use shard::scroll::OrderByInterface;

use super::*;
use crate::repr::*;

#[pyclass(name = "QueryRequest")]
#[derive(Clone, Debug, Into)]
pub struct PyQueryRequest(ShardQueryRequest);

#[pyclass_repr]
#[pymethods]
impl PyQueryRequest {
    #[new]
    #[pyo3(signature = (
        limit,
        offset = None,
        query = None,
        prefetches = None,
        with_vector = None,
        with_payload = None,
        filter = None,
        score_threshold = None,
        params = None,
    ))]
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        limit: usize,
        offset: Option<usize>,
        query: Option<PyScoringQuery>,
        prefetches: Option<Vec<PyPrefetch>>,
        with_vector: Option<PyWithVector>,
        with_payload: Option<PyWithPayload>,
        filter: Option<PyFilter>,
        score_threshold: Option<f32>,
        params: Option<PySearchParams>,
    ) -> Self {
        Self(ShardQueryRequest {
            prefetches: PyPrefetch::peel_vec(prefetches.unwrap_or_default()),
            limit,
            offset: offset.unwrap_or(0),
            with_vector: with_vector.map(WithVector::from).unwrap_or_default(),
            with_payload: with_payload
                .map(WithPayloadInterface::from)
                .unwrap_or_default(),
            query: query.map(ScoringQuery::from),
            filter: filter.map(Filter::from),