You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/05/20 09:10:45 UTC
[GitHub] [superset] villebro opened a new pull request, #20140: chore(data-table): make formatted dttm the default
villebro opened a new pull request, #20140:
URL: https://github.com/apache/superset/pull/20140
### SUMMARY
This PR changes time formatting to be the default for temporal columns (previously defaulted to showing the original value).
TBD
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TBD
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #20140: chore(data-table): make formatted dttm the default
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #20140:
URL: https://github.com/apache/superset/pull/20140#discussion_r877928274
##########
superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts:
##########
@@ -113,87 +154,45 @@ test('use only the first record columns', () => {
},
{
Cell: expect.any(Function),
- Header: 'col03',
- accessor: expect.any(Function),
- id: 'col03',
- },
- {
- Cell: expect.any(Function),
- Header: asciiKey,
- accessor: expect.any(Function),
- id: asciiKey,
- },
- {
- Cell: expect.any(Function),
- Header: unicodeKey,
- accessor: expect.any(Function),
- id: unicodeKey,
- },
- ]);
-
- hook.result.current.forEach((col: JsonObject) => {
- expect(col.accessor(newData[0])).toBe(newData[0][col.Header]);
- });
-
- 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);
- });
Review Comment:
This logic was incorrect, and caused each cell formatter to process each value on the row
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #20140: chore(data-table): make formatted dttm the default
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #20140:
URL: https://github.com/apache/superset/pull/20140#issuecomment-1132736157
# [Codecov](https://codecov.io/gh/apache/superset/pull/20140?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#20140](https://codecov.io/gh/apache/superset/pull/20140?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9b57993) into [master](https://codecov.io/gh/apache/superset/commit/e2f11d3680a8f8a0fba7746b13551e49cdca7fd6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e2f11d3) will **increase** coverage by `0.00%`.
> The diff coverage is `50.00%`.
```diff
@@ 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
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `51.33% <50.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/20140?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...et-frontend/src/explore/reducers/exploreReducer.js](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZXhwbG9yZVJlZHVjZXIuanM=) | `28.75% <0.00%> (ø)` | |
| [...t-frontend/src/explore/reducers/getInitialState.ts](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZ2V0SW5pdGlhbFN0YXRlLnRz) | `0.00% <ø> (ø)` | |
| [superset-frontend/src/utils/localStorageHelpers.ts](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2xvY2FsU3RvcmFnZUhlbHBlcnMudHM=) | `90.00% <ø> (ø)` | |
| [.../src/explore/components/DataTableControl/index.tsx](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhVGFibGVDb250cm9sL2luZGV4LnRzeA==) | `71.79% <72.72%> (+1.12%)` | :arrow_up: |
| [...set-frontend/src/explore/actions/exploreActions.ts](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9leHBsb3JlQWN0aW9ucy50cw==) | `50.00% <100.00%> (ø)` | |
| [...nd/src/explore/components/DataTablesPane/index.tsx](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhVGFibGVzUGFuZS9pbmRleC50c3g=) | `71.55% <100.00%> (ø)` | |
| [...lore/components/useOriginalFormattedTimeColumns.ts](https://codecov.io/gh/apache/superset/pull/20140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy91c2VPcmlnaW5hbEZvcm1hdHRlZFRpbWVDb2x1bW5zLnRz) | `75.00% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/20140?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/20140?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [e2f11d3...9b57993](https://codecov.io/gh/apache/superset/pull/20140?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #20140: chore(data-table): make formatted dttm the default
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #20140:
URL: https://github.com/apache/superset/pull/20140#discussion_r878031114
##########
superset-frontend/src/explore/components/DataTableControl/useTableColumns.test.ts:
##########
@@ -28,31 +28,53 @@ const asciiChars = [];
for (let i = 32; i < 127; i += 1) {
asciiChars.push(String.fromCharCode(i));
}
-const asciiKey = asciiChars.join('');
-const unicodeKey = '你好. 吃了吗?';
+const ASCII_KEY = asciiChars.join('');
+const UNICODE_KEY = '你好. 吃了吗?';
+const NUMTIME_KEY = 'numtime';
+const STRTIME_KEY = 'strtime';
+const NUMTIME_VALUE = 1640995200000;
+const NUMTIME_FORMATTED_VALUE = '2022-01-01 00:00:00';
+const STRTIME_VALUE = '2022-01-01';
-const data = [
- { col01: true, col02: false, [asciiKey]: asciiKey, [unicodeKey]: unicodeKey },
- { col01: true, col02: false, [asciiKey]: asciiKey, [unicodeKey]: unicodeKey },
- { col01: true, col02: false, [asciiKey]: asciiKey, [unicodeKey]: unicodeKey },
- {
- col01: true,
- col02: false,
- col03: 'secret',
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro merged pull request #20140: chore(data-table): make formatted dttm the default
Posted by GitBox <gi...@apache.org>.
villebro merged PR #20140:
URL: https://github.com/apache/superset/pull/20140
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org