Skip to content

fix(datetime): only complete an hour-only UTC offset in the parse fallback - #1350

Open
Aryan-Pardeshi wants to merge 1 commit into
qdrant:devfrom
Aryan-Pardeshi:fix/datetime-parse-fallback
Open

fix(datetime): only complete an hour-only UTC offset in the parse fallback#1350
Aryan-Pardeshi wants to merge 1 commit into
qdrant:devfrom
Aryan-Pardeshi:fix/datetime-parse-fallback

Conversation

@Aryan-Pardeshi

Copy link
Copy Markdown

Fixes #1349

parse() ends with an unguarded retry that appends :00 to any string the format list rejected:

# Python can't parse timezones containing only hours (+HH) ...
return parse_available_formats(date_str + ":00")

It exists to turn a trailing +01 into +01:00, but it also completes truncated datetimes:

input retried as matched by
2024-06-15 12 2024-06-15 12:00 %Y-%m-%d %H:%M
2024-06-15T12:30 2024-06-15T12:30:00 %Y-%m-%dT%H:%M:%S

Neither input is an accepted format — not in available_formats, not in core's list — so local mode accepted values a real instance rejects, and read 2024-06-15 12 as 12:00:00 instead of surfacing it as invalid.

The retry is now guarded on the string actually ending in an hour-only offset (HH:MM[:SS][.fff]±HH).

Tests

New tests/test_datetime_utils.py:

  • every accepted format still parses to the same value, including +05:00 conversion
  • the +HH completion the fallback exists for still works (...000+01, ...000-10, T12:30:45+05)
  • 2024-06-15 12 and 2024-06-15T12:30 now return None — these two fail on dev
  • garbage and empty string still return None

tests/test_in_memory.py and tests/test_common.py pass unchanged.

…lback

parse() appended ":00" to any string the format list rejected. The retry
exists to turn a trailing "+01" into "+01:00", but unguarded it also
completed truncated datetimes: "2024-06-15 12" became "2024-06-15 12:00"
and "2024-06-15T12:30" became "2024-06-15T12:30:00", both of which then
matched. Local mode therefore accepted datetimes qdrant core rejects.

Guard the retry on the string actually ending in an hour-only offset.

Fixes: qdrant#1349
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit 37f0fd1
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/6a8097075ba9770008276cb2
😎 Deploy Preview https://deploy-preview-1350--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Aryan-Pardeshi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8571c5a3-b76c-4b56-9060-7df2ad47359f

📥 Commits

Reviewing files that changed from the base of the PR and between f003e6c and 37f0fd1.

📒 Files selected for processing (2)
  • qdrant_client/local/datetime_utils.py
  • tests/test_datetime_utils.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Successfully merging this pull request may close these issues.

1 participant