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

Better error response for wrong datetime format in REST filter #3531

Open
timvisee opened this issue Feb 5, 2024 · 6 comments
Open

Better error response for wrong datetime format in REST filter #3531

timvisee opened this issue Feb 5, 2024 · 6 comments

Comments

@timvisee
Copy link
Member

timvisee commented Feb 5, 2024

Is your feature request related to a problem? Please describe.
We recently merged #3395 which adds a datetime payload index.

Currently, the datetime parser is very strict, only allowing RFC 3339 formats in our REST API. A common format such as YYYY-MM-DD HH:MM:SS is currently not accepted.

If you'd send the following request:

POST collections/test_collection/points/scroll
{
  "limit": 10,
  "filter": {
    "must": [
      {
        "key": "updated",
        "datetime_range": {
          "gt": "2014-01-01T00:00:00"
        }
      }
    ]
  }
}

You'd receive the following error:

Format error in JSON body: data did not match any variant of untagged enum Condition at line 1 column 96

This error is very confusing.

Describe the solution you'd like
We'd strongly prefer a more descriptive error message instead.

Something like this would be a lot better:

Format error in JSON body: '2014-01-01T00:00:00' does not match any accepted datetime format

Describe alternatives you've considered
None

Additional context
Related issue: #3529

@timvisee timvisee changed the title Better error handling for datetime in REST filter Better error response for wrong datetime format in REST filter Feb 5, 2024
@kartikchoubisa
Copy link

Much needed. I'd rather have it parse multiple formats, but for now I don't mind having at least a better error message.
I could take up this issue

@generall
Copy link
Member

@kartikchoubisa it is already merged

@generall
Copy link
Member

/bounty $100

Copy link

algora-pbc bot commented Apr 23, 2024

💎 $100 bounty • Qdrant

Steps to solve:

  1. Start working: Comment /attempt #3531 with your implementation plan
  2. Submit work: Create a pull request including /claim #3531 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to qdrant/qdrant!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @syedbarimanjan Apr 23, 2024, 11:58:24 PM WIP
🟢 @gsaivinay Apr 24, 2024, 7:12:42 PM #4111

@gsaivinay
Copy link
Contributor

gsaivinay commented Apr 24, 2024

/attempt #3531

Algora profile Completed bounties Tech Active attempts Options
@gsaivinay 1 Qdrant bounty
Python
Cancel attempt

Copy link

algora-pbc bot commented Apr 24, 2024

💡 @gsaivinay submitted a pull request that claims the bounty. You can visit your bounty board to reward.

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

No branches or pull requests

4 participants