Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not get "time" from api using the sdk #647

Open
jiangying000 opened this issue Jun 13, 2024 · 4 comments
Open

can not get "time" from api using the sdk #647

jiangying000 opened this issue Jun 13, 2024 · 4 comments

Comments

@jiangying000
Copy link

when delete by filter through api:

curl --location 'http://x:6333/collections/col/points/delete?wait=true' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "filter": {
        "must": [
            {
                "key": "metadata.file_id",
                "match": {
                    "value": "abcd6dee-03ca-4d38-a45f-51d941fe2c01"
                }
            }
        ]
    }
}
'

result:

{
    "result": {
        "operation_id": 28272,
        "status": "completed"
    },
    "status": "ok",
    "time": 0.002382941
}

but through sdk, i can only get

class UpdateResult(BaseModel):
    operation_id: Optional[int] = Field(default=None, description="Sequential number of the operation")
    status: "UpdateStatus" = Field(..., description="")

) -> types.UpdateResult:

So the "status" and "time" field is omitted, can I get then when using sdk?

usage:

import qdrant_client

async_qdrant_client = qdrant_client.AsyncQdrantClient()

            res = await async_qdrant_client.delete(collection_name="col", points_selector=Filter(
                must=[FieldCondition(key='metadata.file_id', match=MatchValue(value=file_id_str))]
            ))

res is: operation_id=30016 status=<UpdateStatus.COMPLETED: 'completed'>
no "status" and "time" field

@joein
Copy link
Member

joein commented Jun 13, 2024

Hi @jiangying000

No, those fields are unavailable in public qdrant-client API

If you really need to, you can make requests from within qdrant-client on your own by utilising a bit low level API

if you create your client like

client = qdrant_client.QdrantClient()

then those API's can be reached as client._client.rest.<type of endpoint>.<method>

where <type of endpoint> is one of

[
    self.cluster_api,
    self.collections_api,
    self.points_api, 
    self.service_api,
    self.snapshots_api
]

But we do not recommend using those APIs directly

@jiangying000
Copy link
Author

No, those fields are unavailable in public qdrant-client API

it's an useful parametric, so please consider add them, like ElasticSearch always has this field, I can know the network cost and service internal processing time parts of a api latency.

@jiangying000
Copy link
Author

image

by the way, I see the api doc mention time and status field https://qdrant.github.io/qdrant/redoc/index.html#tag/points/operation/delete_points

@joein
Copy link
Member

joein commented Jun 13, 2024

it's not the python client's doc, but the general openapi doc, you can get those values with pure http calls, but we don't expose them in the client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants