Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into entity-events-api…
Browse files Browse the repository at this point in the history
…-descriptions
  • Loading branch information
eboneil committed Feb 5, 2024
2 parents 7a4d51b + 3bfc1e4 commit e53f032
Show file tree
Hide file tree
Showing 116 changed files with 5,590 additions and 211 deletions.
18 changes: 18 additions & 0 deletions .github/scripts/check_python_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import setuptools

folders = ["./smoke-test/tests"]

for folder in folders:
print(f"Checking folder {folder}")
a = [i for i in setuptools.find_packages(folder) if "cypress" not in i]
b = [i for i in setuptools.find_namespace_packages(folder) if "cypress" not in i]

in_a_not_b = set(a) - set(b)
in_b_not_a = set(b) - set(a)

assert (
len(in_a_not_b) == 0
), f"Found packages in {folder} that are not in namespace packages: {in_a_not_b}"
assert (
len(in_b_not_a) == 0
), f"Found namespace packages in {folder} that are not in packages: {in_b_not_a}"
33 changes: 21 additions & 12 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,29 @@ env:
DATAHUB_INGESTION_IMAGE: "acryldata/datahub-ingestion"

jobs:
check_lint:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: hsheth2/sane-checkout-action@v1
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- name: Ensure packages are correct
run: |
python ./.github/scripts/check_python_package.py
- name: Run lint on smoke test
run: |
./gradlew :smoke-test:lint
setup:
runs-on: ubuntu-latest
needs: check_lint
outputs:
tag: ${{ steps.tag.outputs.tag }}
slim_tag: ${{ steps.tag.outputs.slim_tag }}
Expand All @@ -64,18 +85,6 @@ jobs:
steps:
- name: Check out the repo
uses: hsheth2/sane-checkout-action@v1
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: 17
- name: Run lint on smoke test
run: |
./gradlew :smoke-test:lint
- name: Compute Tag
id: tag
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import com.linkedin.datahub.graphql.generated.QuerySubject;
import com.linkedin.datahub.graphql.generated.QuickFilter;
import com.linkedin.datahub.graphql.generated.RecommendationContent;
import com.linkedin.datahub.graphql.generated.ResolvedAuditStamp;
import com.linkedin.datahub.graphql.generated.SchemaField;
import com.linkedin.datahub.graphql.generated.SchemaFieldEntity;
import com.linkedin.datahub.graphql.generated.SearchAcrossLineageResult;
Expand Down Expand Up @@ -1642,7 +1643,7 @@ private void configureResolvedAuditStampResolvers(final RuntimeWiring.Builder bu
typeWiring.dataFetcher(
"actor",
new LoadableTypeResolver<>(
corpUserType, (env) -> ((CorpUser) env.getSource()).getUrn())));
corpUserType, (env) -> ((ResolvedAuditStamp) env.getSource()).getActor().getUrn())));
}

/**
Expand Down
29 changes: 0 additions & 29 deletions datahub-graphql-core/src/main/resources/forms.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,6 @@ input SubmitFormPromptInput {
structuredPropertyParams: StructuredPropertyInputParams
}

"""
Input for responding to a singular prompt in a form for a batch of entities
"""
input BatchSubmitFormPromptInput {
"""
The urns of the entities this prompt submission is for
"""
assetUrns: [String!]!

"""
Input for responding to a specific prompt on a form
"""
input: SubmitFormPromptInput
}

"""
Input for collecting structured property values to apply to entities
Expand Down Expand Up @@ -390,18 +376,3 @@ input VerifyFormInput {
"""
entityUrn: String!
}

"""
Input for verifying a batch of entities for a give form
"""
input BatchVerifyFormInput {
"""
The urns of the entities getting verified for this form
"""
assetUrns: [String!]!

"""
The urn of the form being verified on the given entities
"""
formUrn: String!
}
1 change: 1 addition & 0 deletions datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"react-helmet-async": "^1.3.0",
"react-highlighter": "^0.4.3",
"react-icons": "4.3.1",
"react-intersection-observer": "^9.5.3",
"react-js-cron": "^2.1.0",
"react-router": "^5.3",
"react-router-dom": "^5.3",
Expand Down
3 changes: 3 additions & 0 deletions datahub-web-react/src/Mocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export const dataset1 = {
browsePathV2: { path: [{ name: 'test', entity: null }], __typename: 'BrowsePathV2' },
autoRenderAspects: [],
structuredProperties: null,
forms: null,
};

export const dataset2 = {
Expand Down Expand Up @@ -395,6 +396,7 @@ export const dataset2 = {
browsePathV2: { path: [{ name: 'test', entity: null }], __typename: 'BrowsePathV2' },
autoRenderAspects: [],
structuredProperties: null,
forms: null,
};

export const dataset3 = {
Expand Down Expand Up @@ -629,6 +631,7 @@ export const dataset3 = {
lastProfile: null,
lastOperation: null,
structuredProperties: null,
forms: null,
} as Dataset;

export const dataset3WithSchema = {
Expand Down
7 changes: 6 additions & 1 deletion datahub-web-react/src/app/entity/Entity.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EntityType, SearchResult } from '../../types.generated';
import { FetchedEntity } from '../lineage/types';
import { GenericEntityProperties } from './shared/types';
import { EntitySidebarSection, GenericEntityProperties } from './shared/types';

export enum PreviewType {
/**
Expand Down Expand Up @@ -176,4 +176,9 @@ export interface Entity<T> {
* Returns the profile component to be displayed in our Chrome extension
*/
renderEmbeddedProfile?: (urn: string) => JSX.Element;

/**
* Returns the entity profile sidebar sections for an entity type. Only implemented on Datasets for now.
*/
getSidebarSections?: () => EntitySidebarSection[];
}
7 changes: 6 additions & 1 deletion datahub-web-react/src/app/entity/EntityRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FetchedEntity } from '../lineage/types';
import { SearchResultProvider } from '../search/context/SearchResultContext';
import { Entity, EntityCapabilityType, IconStyleType, PreviewType } from './Entity';
import { GLOSSARY_ENTITY_TYPES } from './shared/constants';
import { GenericEntityProperties } from './shared/types';
import { EntitySidebarSection, GenericEntityProperties } from './shared/types';
import { dictToQueryStringParams, getFineGrainedLineageWithSiblings, urlEncodeUrn } from './shared/utils';

function validatedGet<K, V>(key: K, map: Map<K, V>): V {
Expand Down Expand Up @@ -194,6 +194,11 @@ export default class EntityRegistry {
return entity.displayName(data);
}

getSidebarSections(type: EntityType): EntitySidebarSection[] {
const entity = validatedGet(type, this.entityTypeToEntity);
return entity.getSidebarSections ? entity.getSidebarSections() : [];
}

getGenericEntityProperties<T>(type: EntityType, data: T): GenericEntityProperties | null {
const entity = validatedGet(type, this.entityTypeToEntity);
return entity.getGenericEntityProperties(data);
Expand Down
84 changes: 42 additions & 42 deletions datahub-web-react/src/app/entity/dataset/DatasetEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,51 +190,51 @@ export class DatasetEntity implements Entity<Dataset> {
},
},
]}
sidebarSections={[
{
component: SidebarAboutSection,
},
{
component: SidebarOwnerSection,
properties: {
defaultOwnerType: OwnershipType.TechnicalOwner,
},
},
{
component: SidebarSiblingsSection,
display: {
visible: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.siblings?.siblings?.length || 0) > 0,
},
},
{
component: SidebarViewDefinitionSection,
display: {
visible: (_, dataset: GetDatasetQuery) =>
(dataset?.dataset?.viewProperties?.logic && true) || false,
},
},
{
component: SidebarTagsSection,
properties: {
hasTags: true,
hasTerms: true,
},
},
{
component: SidebarDomainSection,
},
{
component: DataProductSection,
},
// TODO: Add back once entity-level recommendations are complete.
// {
// component: SidebarRecommendationsSection,
// },
]}
sidebarSections={this.getSidebarSections()}
/>
);

getSidebarSections = () => [
{
component: SidebarAboutSection,
},
{
component: SidebarOwnerSection,
properties: {
defaultOwnerType: OwnershipType.TechnicalOwner,
},
},
{
component: SidebarSiblingsSection,
display: {
visible: (_, dataset: GetDatasetQuery) => (dataset?.dataset?.siblings?.siblings?.length || 0) > 0,
},
},
{
component: SidebarViewDefinitionSection,
display: {
visible: (_, dataset: GetDatasetQuery) => (dataset?.dataset?.viewProperties?.logic && true) || false,
},
},
{
component: SidebarTagsSection,
properties: {
hasTags: true,
hasTerms: true,
},
},
{
component: SidebarDomainSection,
},
{
component: DataProductSection,
},
// TODO: Add back once entity-level recommendations are complete.
// {
// component: SidebarRecommendationsSection,
// },
];

getOverridePropertiesFromEntity = (dataset?: Dataset | null): GenericEntityProperties => {
// if dataset has subTypes filled out, pick the most specific subtype and return it
const subTypes = dataset?.subTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
import { useAppConfig } from '../../../../useAppConfig';
import { useUpdateDomainEntityDataOnChange } from '../../../../domain/utils';
import ProfileSidebar from './sidebar/ProfileSidebar';
import SidebarFormInfoWrapper from './sidebar/FormInfo/SidebarFormInfoWrapper';

type Props<T, U> = {
urn: string;
Expand Down Expand Up @@ -333,7 +334,10 @@ export const EntityProfile = <T, U>({
</TabContent>
</HeaderAndTabsFlex>
</HeaderAndTabs>
<ProfileSidebar sidebarSections={sidebarSections} />
<ProfileSidebar
sidebarSections={sidebarSections}
topSection={{ component: SidebarFormInfoWrapper }}
/>
</>
)}
</ContentContainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import Link from 'antd/lib/typography/Link';
import React from 'react';
import styled from 'styled-components';
import PlatformContent from '../../header/PlatformContent';
import { useEntityData } from '../../../../EntityContext';
import { useEntityRegistry } from '../../../../../../useEntityRegistry';
import { StyledDivider } from '../FormInfo/components';
import { DatasetStatsSummarySubHeader } from '../../../../../dataset/profile/stats/stats/DatasetStatsSummarySubHeader';
import LinkOut from '../../../../../../../images/link-out.svg?react';
import FormInfo from '../FormInfo/FormInfo';

const EntityName = styled.div`
font-size: 16px;
font-weight: 700;
line-height: 24px;
margin-bottom: 8px;
`;

const EntityInfoWrapper = styled.div`
padding-top: 20px;
`;

const StyledLink = styled(Link)`
font-size: 14px;
line-height: 18px;
display: inline-flex;
align-items: center;
svg {
height: 14px;
width: 14px;
}
`;

const FormInfoWrapper = styled.div`
margin-top: 12px;
`;

interface Props {
formUrn: string;
}

export default function EntityInfo({ formUrn }: Props) {
const entityRegistry = useEntityRegistry();
const { entityType, entityData } = useEntityData();
const entityName = entityData ? entityRegistry.getDisplayName(entityType, entityData) : '';

return (
<EntityInfoWrapper>
<PlatformContent />
<EntityName>{entityName}</EntityName>
<StyledLink
href={entityRegistry.getEntityUrl(entityType, entityData?.urn || '')}
target="_blank"
rel="noreferrer noopener"
>
View Profile <LinkOut style={{ marginLeft: '4px' }} />
</StyledLink>
<DatasetStatsSummarySubHeader properties={{ shouldWrap: true }} />
<FormInfoWrapper>
<FormInfo shouldDisplayBackground formUrn={formUrn} />
</FormInfoWrapper>
<StyledDivider />
</EntityInfoWrapper>
);
}
Loading

0 comments on commit e53f032

Please sign in to comment.