-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix: BROS-200: Pad fractional seconds to 3 digits for consistent D3 parsing #8056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…arsing TimeSeries component now automatically pads fractional seconds in timestamps to exactly 3 decimal places to ensure consistent D3 parsing. This prevents parsing failures when timestamps have inconsistent decimal precision. Examples: - "2025-07-06 16:35:17.0" → "2025-07-06 16:35:17.000" - "2025-07-06 16:35:18.5" → "2025-07-06 16:35:18.500" - "2025-07-06 16:35:19.12" → "2025-07-06 16:35:19.120" Changes: - Add fractional seconds padding logic in TimeSeries dataObj view - Preserve existing microseconds truncation functionality - Add comprehensive unit tests covering various timestamp formats - Fix test environment mock to include required messages property The padding works alongside existing microseconds conversion and handles mixed timestamp formats within the same dataset.
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-storybook canceled.
|
✅ Deploy Preview for label-studio-playground canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8056 +/- ##
===========================================
- Coverage 70.37% 65.89% -4.48%
===========================================
Files 719 505 -214
Lines 51023 33497 -17526
Branches 8621 8622 +1
===========================================
- Hits 35906 22074 -13832
+ Misses 15114 11420 -3694
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/git merge
|
PR Description
Reason for Change
The TimeSeries component was failing to parse timestamps with inconsistent fractional second precision (e.g.,
.0,.5,.12) when using D3'sutcParsefunction. This caused parsing failures and prevented proper visualization of time series data.Problem: D3's time parsing expects consistent decimal precision, but real-world timestamp data often has varying fractional seconds (1, 2, or 3 digits).
Solution: Implement automatic padding of fractional seconds to exactly 3 decimal places before D3 parsing, ensuring consistent format while preserving data integrity.
Screenshots/Evidence
Video demonstration shows the fix in action:
2025-07-06 16:35:17.0and2025-07-06 16:35:17.5fail D3 parsing2025-07-06 16:35:17.000and2025-07-06 16:35:17.500for successful parsingRollout Strategy
FF_TIMESERIES_SYNCflagTesting
Unit Tests Added:
should pad single digit fractional seconds to 3 digitsshould pad two digit fractional seconds to 3 digitsshould leave three digit fractional seconds unchangedshould handle microseconds and pad remaining digits correctlyshould handle timestamps without fractional secondsshould handle mixed fractional second formats in the same datasetTest Coverage:
Risks
Low Risk:
Mitigation:
Reviewer Notes
Key Implementation Details:
TimeSeries.jsxdataObjgetter (lines ~380)/\.(\d{0,3})\b/to match and pad fractional secondsmessagespropertyCode Quality:
General Notes
Impact:
Technical Details:
The implementation successfully addresses the core issue while maintaining code quality and comprehensive test coverage.