Skip to content

Fix timedelta accepting trailing text - #1039

Merged
mauvilsa merged 1 commit into
mauvilsa:mainfrom
draarivpatel-ui:fix-timedelta-trailing-text
Nov 25, 2026
Merged

mauvilsa merged 1 commit into
mauvilsa:mainfrom
draarivpatel-ui:fix-timedelta-trailing-text

Conversation

@draarivpatel-ui

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes timedelta parsing so text after an otherwise valid duration is rejected instead of silently ignored. For example, 1:2:3 trailing previously parsed as 1:02:03.

Adds regression tests through the public parser API.

Before submitting

  • Did you read the contributing guideline?
  • If you used a coding agent, did you fully understand and validate all generated code and ensure it follows the contributing guidelines?
  • Did you update the documentation? (readme and public docstrings)
  • Did you write unit tests such that there is 100% coverage on related code? (required for bug fixes and new features)
  • Did you verify that new and existing tests pass locally?
  • If this is a bug fix, did you verify that the tests fail without the code fix?
  • Did you make sure that all changes preserve backward compatibility?
  • Did you update the CHANGELOG including a pull request link? (not for typos, docs, test updates, or minor internal changes/refactors)

Validation: nice -n 19 .venv/bin/python -m pytest -q passed with 2932 passed, 21 skipped, 292 subtests passed.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 00:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The pull request appears safe to merge.

Summary

Changes timedelta_deserializer to require the entire string to match a duration.

  • Timedelta text must match the whole input.

Reviews (1) · Last reviewed commit: "Reject trailing text in timedelta values" · Reviewed by Greptile

@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (29d6f00) to head (d2c7c8a).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1039   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines        10109     10109           
=========================================
  Hits         10109     10109           

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

@mauvilsa mauvilsa added the bug Something isn't working label Nov 25, 2026

@mauvilsa mauvilsa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you very much for contributing! Looks good.

@mauvilsa
mauvilsa merged commit 539dae4 into mauvilsa:main Nov 25, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants