Repository navigation
Keep the time shape of a column placed after another - #44
Merged
Merged
Conversation
A column with an `after` (or a created/updated/closed name pair) was set to what it follows plus a random gap, discarding the draw its business_hours had shaped, and a gap past --as-of was clamped to as-of midnight. The gap now decides roughly when and business_hours the weekday and hour; a gap past the window is drawn again. `when` columns filled on day 0 are placed the same way. The README's determinism promise is now per version: a release may change what a seed produces, and the changelog says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A date/timestamp column with a dependency (an explicit
after, or a created/updated/closed name pair) lost its time shape:order_row_timesreplaced its drawn value withlatest_required + expovariate(mean 3 days), sobusiness_hourson the column (or--business-hours) had no effect. A gap past the window was clamped to as-of midnight, piling rows onto one timestamp.Repro (5,000 rows, seed 1, as-of 2026-10-01;
scheduled_forhasafter: booked_at+business_hours: true):scheduled_forin weekday 08:00–17:59shaped_alone: 73.2%)--business-hours2026-10-01 00:00:00booked_atFix
place_afteringenerate/timeline.py: the gap still decides roughly when. With business hours (the column's own hint or the run's), weekends are kept 3 in 10 and a timestamp's hour is drawn fromHOUR_WEIGHTSon the gap's day. A draw past the window is drawn again; after 20 tries the value is placed evenly between the column it follows and the window end.order_row_timestakes the run'stime_profile.whencolumns filled on day 0 (_moment,settle) use the same helper.Determinism
The README's promise is now per version: same model, seed,
--as-ofand options give the same bytes on any machine and any day with the same model2data version. A release that changes what a seed produces says so in the changelog.tests/test_determinism.pystill fails on any unintended byte change; its docstring and message say when re-recording is allowed.Only one recorded case changed (
skew:saas_platformwith--skew 0.8), because the cases run at 40 rows. Real models of a few hundred rows or more with a timestamp chain will change, and the CHANGELOG says so.Tests
tests/test_timeline.py: business hours kept underafter(column hint and run-level), no pile-up at as-of midnight,place_afterbounds.tydiagnostics unchanged at 34.🤖 Generated with Claude Code