Conversation
When pretty-printing Series and Frame values in F# Interactive (FSI), DateTime keys whose time component is 00:00:00 now format as date-only (using the short-date 'd' format from the current culture), matching the behaviour already present in SaveCsv. Previously, a Series<DateTime, float> with day-granularity keys would print keys as '1/1/2023 12:00:00 AM' on every row, cluttering the output. After this fix they print as '1/1/2023'. Changes: - Added Formatting.formatKey helper in Common.fs that applies the date-only rule to DateTime values with TimeOfDay = TimeSpan.Zero. - Used Formatting.formatKey in the getLevel helper in both Frame.fs and Series.fs (FormatStrings table rendering). - Used Formatting.formatKey in Series.ToString() (inline FSI representation). - Added 4 regression tests in tests/Deedle.Tests/Formatting.fs. Fixes #95. Co-authored-by: Copilot <[email protected]>
This was referenced Mar 17, 2026
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.
🤖 This is an automated fix from Repo Assist.
Closes #95
Root cause
Series.FormatStrings,Frame.FormatStrings, andSeries.ToString()all format index keys using.ToString()directly. ForDateTimevalues, this always includes the time component — even when it is00:00:00— producing noisy output like1/1/2023 12:00:00 AMfor every row of a day-granularity time series.The CSV exporter in
FrameUtils.fsalready applied a per-key rule: ifdt.TimeOfDay = TimeSpan.Zeroformat as date-only ("d"). The FSI prettyprint code was missing this behaviour.Fix
Added a
Formatting.formatKeyhelper toCommon.fs:DateTime keys with a non-zero time component are unaffected.
Trade-offs
CultureInfo.CurrentCulturefor locale-appropriate formatting, matching the CSV exporter.Test Status
tests/Deedle.Tests/Formatting.fsdotnet test tests/Deedle.Tests/Deedle.Tests.fsproj -c Release)