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/11/20 21:32:52 UTC

[GitHub] [superset] michael-s-molina opened a new pull request, #22173: feat: Uses new table component in Drill to Detail

michael-s-molina opened a new pull request, #22173:
URL: https://github.com/apache/superset/pull/22173

   ### SUMMARY
   Uses the new table component in Drill to Detail to benefit from virtualization and deal with tables with many columns.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   TODO
   
   ### TESTING INSTRUCTIONS
   TODO
   
   ### ADDITIONAL INFORMATION
   - [ ] 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] geido commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
geido commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1330902142

   /testenv up FEATURE_DRILL_TO_DETAIL=true


-- 
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] github-actions[bot] commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1330907921

   @geido Ephemeral environment spinning up at http://52.41.165.144:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
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] geido commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
geido commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1330890116

   /testenv up


-- 
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] github-actions[bot] commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1330893461

   @geido Ephemeral environment spinning up at http://35.92.48.144:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


-- 
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 #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1330744420

   # [Codecov](https://codecov.io/gh/apache/superset/pull/22173?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 [#22173](https://codecov.io/gh/apache/superset/pull/22173?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fda2b66) into [master](https://codecov.io/gh/apache/superset/commit/eba7b3d074350c3429778259baef19b7995f60ae?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (eba7b3d) will **increase** coverage by `0.04%`.
   > The diff coverage is `45.71%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #22173      +/-   ##
   ==========================================
   + Coverage   66.86%   66.90%   +0.04%     
   ==========================================
     Files        1840     1845       +5     
     Lines       70160    70234      +74     
     Branches     7657     7679      +22     
   ==========================================
   + Hits        46909    46989      +80     
   + Misses      21281    21254      -27     
   - Partials     1970     1991      +21     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `53.79% <45.71%> (+0.10%)` | :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/22173?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../components/Chart/DrillDetail/DrillDetailModal.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxEZXRhaWwvRHJpbGxEZXRhaWxNb2RhbC50c3g=) | `92.30% <ø> (ø)` | |
   | [...ts/Table/header-renderers/HeaderWithRadioGroup.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGUvaGVhZGVyLXJlbmRlcmVycy9IZWFkZXJXaXRoUmFkaW9Hcm91cC50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...c/components/Chart/DrillDetail/DrillDetailPane.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ2hhcnQvRHJpbGxEZXRhaWwvRHJpbGxEZXRhaWxQYW5lLnRzeA==) | `75.53% <42.10%> (-7.19%)` | :arrow_down: |
   | [...ponents/Table/cell-renderers/BooleanCell/index.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGUvY2VsbC1yZW5kZXJlcnMvQm9vbGVhbkNlbGwvaW5kZXgudHN4) | `100.00% <100.00%> (ø)` | |
   | [...components/Table/cell-renderers/NullCell/index.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGUvY2VsbC1yZW5kZXJlcnMvTnVsbENlbGwvaW5kZXgudHN4) | `100.00% <100.00%> (ø)` | |
   | [...components/Table/cell-renderers/TimeCell/index.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGUvY2VsbC1yZW5kZXJlcnMvVGltZUNlbGwvaW5kZXgudHN4) | `100.00% <100.00%> (ø)` | |
   | [superset-frontend/src/components/Table/index.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGUvaW5kZXgudHN4) | `74.02% <100.00%> (+10.86%)` | :arrow_up: |
   | [...nd/src/hooks/useTruncation/useCSSTextTruncation.ts](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2hvb2tzL3VzZVRydW5jYXRpb24vdXNlQ1NTVGV4dFRydW5jYXRpb24udHM=) | `69.23% <0.00%> (-30.77%)` | :arrow_down: |
   | [...Filters/FilterBar/FilterControls/FilterDivider.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL0ZpbHRlckRpdmlkZXIudHN4) | `81.48% <0.00%> (-18.52%)` | :arrow_down: |
   | [...rontend/src/components/DropdownContainer/index.tsx](https://codecov.io/gh/apache/superset/pull/22173/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRHJvcGRvd25Db250YWluZXIvaW5kZXgudHN4) | `78.57% <0.00%> (-1.43%)` | :arrow_down: |
   | ... and [18 more](https://codecov.io/gh/apache/superset/pull/22173/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] michael-s-molina merged pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
michael-s-molina merged PR #22173:
URL: https://github.com/apache/superset/pull/22173


-- 
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] michael-s-molina commented on a diff in pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22173:
URL: https://github.com/apache/superset/pull/22173#discussion_r1036171988


##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx:
##########
@@ -89,30 +102,64 @@ export default function DrillDetailPane({
     return resultsPages.get(lastPageIndex.current);
   }, [pageIndex, resultsPages]);
 
-  // this is to preserve the order of the columns, even if there are integer values,
-  // while also only grabbing the first column's keys
-  const columns = useTableColumns(
-    resultsPage?.colNames,
-    resultsPage?.colTypes,
-    resultsPage?.data,
-    formData.datasource,
+  const mappedColumns: ColumnsType<DataType> = useMemo(
+    () =>
+      resultsPage?.colNames.map((column, index) => ({
+        key: column,
+        dataIndex: column,
+        title:
+          resultsPage?.colTypes[index] === GenericDataType.TEMPORAL ? (
+            <HeaderWithRadioGroup
+              headerTitle={column}
+              groupTitle={t('Formatting')}
+              groupOptions={[
+                { label: t('Original value'), value: 'original' },
+                { label: t('Formatted value'), value: 'formatted' },
+              ]}
+              value={
+                timeFormatting[column] === 'original' ? 'original' : 'formatted'

Review Comment:
   Done ✅ 



-- 
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] github-actions[bot] commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1332693909

   Ephemeral environment shutdown and build artifacts deleted.


-- 
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] michael-s-molina commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1329269543

   @eric-briscoe I noticed an error in the browser console when paginating. It seems an internal table error. Can you check?


-- 
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] geido commented on a diff in pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
geido commented on code in PR #22173:
URL: https://github.com/apache/superset/pull/22173#discussion_r1034958592


##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailPane.tsx:
##########
@@ -89,30 +102,64 @@ export default function DrillDetailPane({
     return resultsPages.get(lastPageIndex.current);
   }, [pageIndex, resultsPages]);
 
-  // this is to preserve the order of the columns, even if there are integer values,
-  // while also only grabbing the first column's keys
-  const columns = useTableColumns(
-    resultsPage?.colNames,
-    resultsPage?.colTypes,
-    resultsPage?.data,
-    formData.datasource,
+  const mappedColumns: ColumnsType<DataType> = useMemo(
+    () =>
+      resultsPage?.colNames.map((column, index) => ({
+        key: column,
+        dataIndex: column,
+        title:
+          resultsPage?.colTypes[index] === GenericDataType.TEMPORAL ? (
+            <HeaderWithRadioGroup
+              headerTitle={column}
+              groupTitle={t('Formatting')}
+              groupOptions={[
+                { label: t('Original value'), value: 'original' },
+                { label: t('Formatted value'), value: 'formatted' },
+              ]}
+              value={
+                timeFormatting[column] === 'original' ? 'original' : 'formatted'

Review Comment:
   What do you think about using an Enum for these two values?



-- 
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] eric-briscoe commented on a diff in pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
eric-briscoe commented on code in PR #22173:
URL: https://github.com/apache/superset/pull/22173#discussion_r1033953435


##########
superset-frontend/src/components/Table/cell-renderers/TimeCell/TimeCell.test.tsx:
##########
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { TimeFormats } from '@superset-ui/core';
+import React from 'react';
+import { render, screen } from 'spec/helpers/testing-library';
+import TimeCell from '.';
+
+const DATE = Date.parse('2022-01-01');
+
+test('renders with default format', async () => {
+  render(<TimeCell value={DATE} />);
+  expect(screen.getByText('2022-01-01 00:00:00')).toBeInTheDocument();
+});
+
+test('renders with custom format', async () => {
+  render(<TimeCell value={DATE} format={TimeFormats.DATABASE_DATE} />);
+  expect(screen.getByText('2022-01-01')).toBeInTheDocument();
+});
+
+test('renders with number', async () => {

Review Comment:
   @michael-s-molina can we add tests that pass a mixture of null | undefined| invalid time formats as we as mix of invalid DATE values to ensure the cell renderer does not throw runtime error and break app in case a single row has bad / missing data?  I think we want to make cell renderers fault tolerant especially when doing error prone translations like dates.  antd does not give us an error protection on cell rendering so we have to make sure our cell renderers do not throw error that will break the render loop for entire table component / app



##########
superset-frontend/src/components/Table/cell-renderers/TimeCell/index.tsx:
##########
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { getTimeFormatter, TimeFormats } from '@superset-ui/core';
+
+export interface TimeCellProps {
+  format?: string;
+  value: number | Date;
+}
+
+function TimeCell({
+  format = TimeFormats.DATABASE_DATETIME,
+  value,
+}: TimeCellProps) {
+  const timeFormatter = getTimeFormatter(format);
+  return <span>{timeFormatter.format(value)}</span>;

Review Comment:
   @michael-s-molina pairing this with comment on superset-frontend/src/components/Table/cell-renderers/TimeCell/TimeCell.test.tsx for testing with bad data formats / formats value mismatch to make sure we are handling any potential errors due to bad dat values for a 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] michael-s-molina commented on pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on PR #22173:
URL: https://github.com/apache/superset/pull/22173#issuecomment-1332408027

   @geido @codyml I addressed your comments in the last commit.
   
   https://user-images.githubusercontent.com/70410625/204849854-e9a7b678-c64a-4df3-a7d7-4b7f675f9365.mov
   
   


-- 
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] michael-s-molina commented on a diff in pull request #22173: feat: Uses new table component in Drill to Detail

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22173:
URL: https://github.com/apache/superset/pull/22173#discussion_r1034772980


##########
superset-frontend/src/components/Table/cell-renderers/TimeCell/TimeCell.test.tsx:
##########
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { TimeFormats } from '@superset-ui/core';
+import React from 'react';
+import { render, screen } from 'spec/helpers/testing-library';
+import TimeCell from '.';
+
+const DATE = Date.parse('2022-01-01');
+
+test('renders with default format', async () => {
+  render(<TimeCell value={DATE} />);
+  expect(screen.getByText('2022-01-01 00:00:00')).toBeInTheDocument();
+});
+
+test('renders with custom format', async () => {
+  render(<TimeCell value={DATE} format={TimeFormats.DATABASE_DATE} />);
+  expect(screen.getByText('2022-01-01')).toBeInTheDocument();
+});
+
+test('renders with number', async () => {

Review Comment:
   Good idea. Added ✅ 



##########
superset-frontend/src/components/Table/cell-renderers/TimeCell/index.tsx:
##########
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { getTimeFormatter, TimeFormats } from '@superset-ui/core';
+
+export interface TimeCellProps {
+  format?: string;
+  value: number | Date;
+}
+
+function TimeCell({
+  format = TimeFormats.DATABASE_DATETIME,
+  value,
+}: TimeCellProps) {
+  const timeFormatter = getTimeFormatter(format);
+  return <span>{timeFormatter.format(value)}</span>;

Review Comment:
   👍🏼 



-- 
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