mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 18:07:57 +00:00
fix(dataset stats): Fix checks for existence of row and column counts (#3003)
This commit is contained in:
parent
411bbeab56
commit
beb9b623fb
@ -107,10 +107,12 @@ describe('SnapshotStatsView', () => {
|
||||
// Row Count
|
||||
expect(queryByText('1000')).toBeNull();
|
||||
expect(queryByText('Rows')).toBeNull();
|
||||
expect(queryByText('Row Count Unknown')).toBeInTheDocument();
|
||||
|
||||
// Column Count
|
||||
expect(queryByText('2000')).toBeNull();
|
||||
expect(queryByText('Columns')).toBeNull();
|
||||
expect(queryByText('Column Count Unknown')).toBeInTheDocument();
|
||||
|
||||
// Field Profiles
|
||||
// First column
|
||||
@ -151,11 +151,11 @@ export default function DataProfileView({ profile }: Props) {
|
||||
|
||||
const columnStatsColumns = buildColumnStatsColumns(columnStatsTableData);
|
||||
|
||||
const rowCount = profile?.rowCount || -1;
|
||||
const rowCountTitle = (rowCount > 0 && 'Rows') || '?';
|
||||
const rowCount = (isPresent(profile?.rowCount) ? profile?.rowCount : -1) as number;
|
||||
const rowCountTitle = (rowCount >= 0 && 'Rows') || 'Row Count Unknown';
|
||||
|
||||
const columnCount = profile?.columnCount || -1;
|
||||
const columnCountTitle = (columnCount > 0 && 'Columns') || '?';
|
||||
const columnCount = (isPresent(profile?.columnCount) ? profile?.columnCount : -1) as number;
|
||||
const columnCountTitle = (columnCount >= 0 && 'Columns') || 'Column Count Unknown';
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user