Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Mar 6, 2024
2 parents d64cbce + 4fbe814 commit 2bc00e8
Show file tree
Hide file tree
Showing 51 changed files with 6,353 additions and 454 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
gh-pages:
runs-on: ubuntu-latest
steps:
- uses: acryldata/sane-checkout-action@v3
# We explicitly don't use acryldata/sane-checkout-action because docusaurus runs
# git commands to determine the last change date for each file.
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { DateInterval, TimeSeriesChart } from '../../../../types.generated';
import { computeLines } from '../TimeSeriesChart';

describe('timeSeriesChart', () => {
describe('computeLines', () => {
it('compute lines works works correctly for weekly case', () => {
const chartData = {
const chartData: TimeSeriesChart = {
title: 'Weekly Active Users',
lines: [
{
Expand All @@ -15,7 +16,7 @@ describe('timeSeriesChart', () => {
start: '1672012800000',
end: '1677369600000',
},
interval: 'WEEK',
interval: DateInterval.Week,
};
const result = computeLines(chartData, true);
expect(result[0]).toEqual({
Expand All @@ -35,7 +36,7 @@ describe('timeSeriesChart', () => {
});

it('compute lines works works correctly for monthly case', () => {
const chartData = {
const chartData:TimeSeriesChart = {
title: 'Weekly Active Users',
lines: [
{
Expand All @@ -51,7 +52,7 @@ describe('timeSeriesChart', () => {
start: '1648771200000',
end: '1680307199999',
},
interval: 'MONTH',
interval: DateInterval.Month,
};
const result = computeLines(chartData, true);
expect(result[0]).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import { mocks } from '../../../../../Mocks';
import { SchemaTab } from '../../../shared/tabs/Dataset/Schema/SchemaTab';
import EntityContext from '../../../shared/EntityContext';
import { EntityType, SchemaMetadata } from '../../../../../types.generated';
import { SchemaRow } from'../../../shared/tabs/Dataset/Schema/components/SchemaRow';
import { SchemaRow } from '../../../shared/tabs/Dataset/Schema/components/SchemaRow';

vi.mock('virtualizedtableforantd4', async () => {
return {
...await vi.importActual<object>('virtualizedtableforantd4'),
...(await vi.importActual<object>('virtualizedtableforantd4')),
useVT: () => [{ body: { row: SchemaRow } }, vi.fn()],
};
});
Expand All @@ -38,6 +38,9 @@ describe('Schema', () => {
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand All @@ -60,13 +63,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchema as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand Down Expand Up @@ -97,13 +105,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithTags as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand All @@ -124,13 +137,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithTags as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand All @@ -150,13 +168,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithTags as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand All @@ -176,13 +199,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithPkFk as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand All @@ -202,13 +230,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithPkFk as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand All @@ -234,13 +267,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithKeyValueFields as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand Down Expand Up @@ -273,13 +311,18 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchemaWithoutFields as SchemaMetadata,
},
baseEntity: {},
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand Down Expand Up @@ -325,7 +368,9 @@ describe('Schema', () => {
urn: 'urn:li:dataset:123',
entityType: EntityType.Dataset,
entityData: {
description: 'This is a description',
properties: {
description: 'This is a description',
},
schemaMetadata: sampleSchema as SchemaMetadata,
},
baseEntity: {
Expand All @@ -337,6 +382,9 @@ describe('Schema', () => {
updateEntity: vi.fn(),
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<SchemaTab />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import { mocks } from '../../../../../Mocks';
import TestPageContainer from '../../../../../utils/test-utils/TestPageContainer';
import { Preview } from '../Preview';
import { PreviewType } from '../../../Entity';

describe('Preview', () => {
it('renders', () => {
Expand All @@ -15,6 +16,7 @@ describe('Preview', () => {
name="name"
description="definition"
owners={null}
previewType={PreviewType.PREVIEW}
/>
</TestPageContainer>
</MockedProvider>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import GlossaryTermHeader from '../GlossaryTermHeader';

const glossaryTermHeaderData = {
definition: 'this is sample definition',
termSource: 'termSource',
sourceUrl: 'sourceUrl',
sourceRef: 'Source ref',
fqdn: 'fqdn',
};
Expand All @@ -19,9 +19,9 @@ describe('Glossary Term Header', () => {
<TestPageContainer>
<GlossaryTermHeader
definition={glossaryTermHeaderData.definition}
termSource={glossaryTermHeaderData.termSource}
sourceUrl={glossaryTermHeaderData.sourceUrl}
sourceRef={glossaryTermHeaderData.sourceRef}
fqdn={glossaryTermHeaderData.fqdn}
ownership={undefined}
/>
</TestPageContainer>
</MockedProvider>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('EntityProfile', () => {
display: {
visible: (_, _1) => true,
enabled: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
},
},
{
Expand Down Expand Up @@ -136,8 +136,8 @@ describe('EntityProfile', () => {
display: {
visible: (_, _1) => true,
enabled: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
},
},
{
Expand Down Expand Up @@ -220,8 +220,8 @@ describe('EntityProfile', () => {
display: {
visible: (_, _1) => true,
enabled: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
},
},
{
Expand Down Expand Up @@ -314,12 +314,6 @@ describe('EntityProfile', () => {
{
name: 'Lineage',
component: LineageTab,
display: {
visible: (_, _1) => true,
enabled: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
},
},
{
name: 'Queries',
Expand Down Expand Up @@ -401,8 +395,8 @@ describe('EntityProfile', () => {
display: {
visible: (_, _1) => true,
enabled: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ describe('Form', () => {
urn: '',
entityType: EntityType.Dataset,
entityData: mockEntityDataWithFieldPrompts,
baseEntity: {},
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<Form formUrn="urn:li:form:1" />
Expand All @@ -50,6 +56,12 @@ describe('Form', () => {
urn: '',
entityType: EntityType.Dataset,
entityData: mockEntityData,
baseEntity: {},
routeToTab: vi.fn(),
refetch: vi.fn(),
loading: true,
lineage: undefined,
dataNotCombinedWithSiblings: null,
}}
>
<Form formUrn="urn:li:form:3" />
Expand Down
Loading

0 comments on commit 2bc00e8

Please sign in to comment.