DatetimeExpression causes trailing input error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 304
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 37
Description
When using the new reranking functionality in query_points with a formula that includes a DatetimeExpression the following error is raised:
raise _create_rpc_error(
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Wrong input: InvalidArgument: status: InvalidArgument, message: "failed to parse formula: Service internal error: trailing input", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Mon, 05 May 2025 05:31:47 GMT", "content-length": "0"} }"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Wrong input: InvalidArgument: status: InvalidArgument, message: \"failed to parse formula: Service internal error: trailing input\", details: [], metadata: MetadataMap { headers: {\"content-type\": \"application/grpc\", \"date\": \"Mon, 05 May 2025 05:31:47 GMT\", \"content-length\": \"0\"} }", grpc_status:3, created_time:"2025-05-05T07:31:48.460456036+02:00"}"
Formula used:
reranking_query = models.FormulaQuery(
formula=models.SumExpression(
sum=[
"$score",
models.DatetimeExpression(datetime='2025-05-05T07:18:25.401383')
]
)
)
Code works when replaced by:
reranking_query = models.FormulaQuery(
formula=models.SumExpression(
sum=[
"$score",
datetime.now().timestamp()
]
)
)
Code did not fail when tested with QdrantClient(":memory:"), only fails with the server mode.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Python client’s query_points reranking path, focusing on FormulaQuery, SumExpression, and DatetimeExpression serialization. Reproduce the reported formula against server mode and compare it with the numeric timestamp and in-memory cases. Done means a server accepts the datetime formula without the trailing-input error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100