Uh oh!
There was an error while loading. Please reload this page.
Allow development to accept an age in months relative to origin - #1229
Allow development to accept an age in months relative to origin#1229Abhayindia wants to merge 1 commit into
Conversation
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): 100.0% fully typed (3 / 3); 1 no longer exported
Patch symbol details
|
henrydingliu
commented
Aug 27, 2026
just unblocked tests. expecting ruff and codecov fails. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #1229 +/- ##
==========================================
- Coverage 91.70% 91.61% -0.10%
==========================================
Files 93 93 Lines 5435 5448 +13 Branches 699 703 +4 ==========================================
+ Hits 4984 4991 +7 - Misses 327 331 +4 - Partials 124 126 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
87a5a8f to
1ac7da2Comparehenrydingliu
commented
Aug 30, 2026
moving to draft due to conflicts |
@henrydingliu the conflict is genedan's #1088, which added |
henrydingliu
commented
Sep 1, 2026
good to deprecate test_set_development_age_instead_of_date_raises |
1ac7da2 to
4a0ad6dCompareAbhayindia
commented
Sep 1, 2026
rebased on main - kept the age-in-months tests and dropped test_set_development_age_instead_of_date_raises per your call. |
henrydingliu
commented
Sep 1, 2026
is it a bug that the per-file ignore didn't work? codecov still shows uncovered changes |
Abhayindia
commented
Sep 2, 2026
per-file-ignores only apply to codecov: the uncovered lines are the semiannual-origin ( |
henrydingliu
commented
Sep 2, 2026
understood on ruff format.
does the new prism triangles help? |
Closes#1094 (the enhancement route agreed with @henrydingliu in that thread).
_to_datetimetries%Y%m,%Y,%Y-%m-%dand then falls through to a barepd.to_datetime, which for a numeric column silently reads the values as nanoseconds since epoch. That collapsed age-lag columns like[12, 24, 36]to 1970-01-01, and the old guard just checked whether the result landed in 1970 - so a triangle whose development really is the year 1970 got the same error.This replaces that with a check at the point of parsing: if none of the explicit formats matched and the column is numeric, it's an age in months.
_init_developmentthen resolves each value to the valuation date that many months after the start of that row's origin period. Ages are measured from the origin period start (using the constructor's ownorigin_grain, so mid-period origin dates and fiscal-year anchors line up), not the literal recorded origin date. Bare years still match%Yand are untouched. Non-numeric unparseable input still raises, with the same message as before. Semiannual grains only support the calendar Jan/Jul anchor; a non-calendar one raises a clear error rather than guessing.Verified:
Full suite was 1091 passed / 8 skipped when I posted the branch on the issue.