Skip to content

Fix explicit +/- signs in relative date offsets#1303

Merged
serhii73 merged 3 commits intomasterfrom
fix/1299-yesterday-plus-minus
Jan 31, 2026
Merged

Fix explicit +/- signs in relative date offsets#1303
serhii73 merged 3 commits intomasterfrom
fix/1299-yesterday-plus-minus

Conversation

@serhii73
Copy link
Collaborator

Close #1299

@serhii73 serhii73 self-assigned this Jan 23, 2026
@serhii73 serhii73 changed the title Add tests for relative date time offset parsing WIP Jan 23, 2026
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.62%. Comparing base (920d725) to head (ec3a65e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1303      +/-   ##
==========================================
+ Coverage   96.60%   96.62%   +0.01%     
==========================================
  Files         235      235              
  Lines        2889     2905      +16     
==========================================
+ Hits         2791     2807      +16     
  Misses         98       98              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes parsing of relative date expressions containing explicit +/- time offsets (e.g., "yesterday +1h"), addressing issue #1299.

Changes:

  • Updated FreshnessDateDataParser to recognize signed numeric quantities (e.g., +1 hour, -30 minutes) and apply them correctly.
  • Added regression tests validating "yesterday"/"tomorrow" +/- <offset> parsing behavior via dateparser.parse().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
dateparser/freshness_date_parser.py Extends unit parsing regex to accept +/- and adjusts relativedelta application to respect explicit signs.
tests/test_date_parser.py Adds parameterized coverage for "yesterday"/"tomorrow" +/- offsets plus targeted regression assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@serhii73 serhii73 changed the title WIP Fix explicit +/- signs in relative date offsets Jan 29, 2026
@serhii73 serhii73 requested review from Gallaecio and wRAR January 29, 2026 13:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@serhii73 serhii73 merged commit d2e236f into master Jan 31, 2026
16 checks passed
@serhii73 serhii73 deleted the fix/1299-yesterday-plus-minus branch January 31, 2026 15:11
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.

Problem With '+1-1' in parsing

3 participants