Fix datetime_utils.parse accepting truncated datetimes - #1380
Fix datetime_utils.parse accepting truncated datetimes#1380TarunSinghChauhan wants to merge 1 commit into
Conversation
The hour-only-offset retry (which appends :00 to complete offsets like +01 -> +01:00) was unguarded, so it also fired for any string that failed every format in available_formats - including truncated datetimes like '2024-06-15 12' or '2024-06-15T12:30'. These would get :00 appended and accidentally match a valid format, causing local mode to silently accept input that a real Qdrant instance rejects. Guarded the retry to only fire when the string actually ends in an hour-only UTC offset ([+-]HH). Verified against all four cases from the issue: truncated hour and truncated minute now correctly return None, while the hour-only-offset and valid full date cases still parse correctly. Fixes qdrant#1349.
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe local datetime parser now uses a regular expression to identify strings ending in signed two-digit hour offsets. It appends Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change restricts the datetime retry behavior to hour-only UTC offsets, with no actionable merge-blocking risk remaining beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Fixes #1349. The :00-append retry for hour-only UTC offsets was unguarded, so it also silently accepted truncated datetimes that should be rejected. Guarded the retry to only fire when the string ends in an hour-only offset ([+-]HH).