-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
chore(data-table): make formatted dttm the default #20140
Conversation
hook.result.current.forEach((col: JsonObject) => { | ||
expect(col.Cell({ value: newData[0].col01 })).toBe(BOOL_TRUE_DISPLAY); | ||
expect(col.Cell({ value: newData[0].col02 })).toBe(BOOL_FALSE_DISPLAY); | ||
expect(col.Cell({ value: newData[0].col03 })).toBe('secret'); | ||
expect(col.Cell({ value: newData[0][asciiKey] })).toBe(asciiKey); | ||
expect(col.Cell({ value: newData[0][unicodeKey] })).toBe(unicodeKey); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was incorrect, and caused each cell formatter to process each value on the row
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Codecov Report
@@ Coverage Diff @@
## master #20140 +/- ##
=======================================
Coverage 66.45% 66.45%
=======================================
Files 1721 1721
Lines 64497 64500 +3
Branches 6805 6806 +1
=======================================
+ Hits 42860 42863 +3
Misses 19905 19905
Partials 1732 1732
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
{ | ||
col01: true, | ||
col02: false, | ||
col03: 'secret', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data API never returns "suprise" values for columns that aren't listed in colnames
, hence we don't need to test for this edge case.
SUMMARY
This PR changes time formatting to be the default for temporal columns (previously defaulted to showing the original value). This is done by replacing the
timeFormattedColumns
withoriginalFormattedTimeColumns
throughout the codebase, meaning if a dataset doesn't have defined values for them, they will default to using the time formatter.In addition to changing the default, the
DataTableTemporalHeaderCell
will only be shown for tables where the first cell value isn't a string value. This is because some databases like Druid and SQLite return temporal data in string format, which causes the time formatter to convert the timestamp to UTC, causing x hours of offset. (For Finland, this would show all dates to show as 10 pm the previous day).AFTER
Now the formatted option is the new default:
For datasets that have string-based temporal data, the regular non-temporal header is shown (screenshot from SQLite). Notice the first column
ds
which doesn't have the formatting cog:TESTING INSTRUCTIONS
ADDITIONAL INFORMATION