Skip to content

Comments

docs: Update resolution docstrings to reference truncate instead of round#283

Merged
borchero merged 1 commit intoQuantco:mainfrom
haydena7:fix-datetime-col-docstrings
Feb 20, 2026
Merged

docs: Update resolution docstrings to reference truncate instead of round#283
borchero merged 1 commit intoQuantco:mainfrom
haydena7:fix-datetime-col-docstrings

Conversation

@haydena7
Copy link
Contributor

@haydena7 haydena7 commented Feb 20, 2026

Summary

In dataframely/columns/datetime.py, the docstrings for the Date, Time, Datetime, and Duration classes state that the resolution argument uses the formatting language of the polars datetime round method.

This is semantically confusing, as the actual underlying implementation uses the polars datetime truncate method.

Motivation

While both methods share the same formatting strings, their behavior is materially different. The round method maps values in the second half of an interval to the end of their bucket, whereas truncate maps each value to the start of its bucket. Updating the docstring to reference truncate accurately reflects the strict boundary validation happening under the hood.

Changes

Updated docstrings in Date, Time, Datetime, and Duration to replace "round method" with "truncate method".

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 20, 2026
@haydena7 haydena7 changed the title docs: update resolution docstrings to reference truncate instead of round docs: Update resolution docstrings to reference truncate instead of round Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (573b564) to head (769acb7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #283   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           54        54           
  Lines         3125      3125           
=========================================
  Hits          3125      3125           

☔ 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

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

This pull request corrects a semantic inaccuracy in the docstrings for datetime-related column types. The docstrings previously referenced the polars round method for the resolution parameter's formatting language, but the actual implementation uses the polars truncate method. While both methods share the same formatting strings, their behavior differs materially: round maps values to bucket endpoints, whereas truncate maps to bucket starts. This documentation update ensures accuracy and clarity for users understanding the strict boundary validation behavior.

Changes:

  • Updated docstrings in Date, Time, Datetime, and Duration classes to reference truncate method instead of round method

Copy link
Member

@borchero borchero left a comment

Choose a reason for hiding this comment

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

Thanks!

@borchero borchero merged commit 3518676 into Quantco:main Feb 20, 2026
39 of 40 checks passed
@haydena7 haydena7 deleted the fix-datetime-col-docstrings branch February 20, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants