Skip to content

Commit

Permalink
[wip] fix ui bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonhyejin committed Jan 16, 2025
1 parent 314b869 commit 43e3d07
Show file tree
Hide file tree
Showing 7 changed files with 481 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function MLModelSummary() {
const baseEntity = useBaseEntity<GetDataProcessInstanceQuery>();
const dpi = baseEntity?.dataProcessInstance;

print("dpi TRP", dpi?.mlTrainingRunProperties);
console.log("dpi", dpi);

const formatDate = (timestamp?: number) => {
if (!timestamp) return '-';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default function MLModelSummary() {
const model = baseEntity?.mlModel;
const entityRegistry = useEntityRegistry();

Check warning on line 50 in datahub-web-react/src/app/entity/mlModel/profile/MLModelSummary.tsx

View check run for this annotation

Codecov / codecov/patch

datahub-web-react/src/app/entity/mlModel/profile/MLModelSummary.tsx#L50

Added line #L50 was not covered by tests
console.log("model", model);

const propertyTableColumns = [
{
title: 'Name',
Expand All @@ -68,9 +70,11 @@ export default function MLModelSummary() {

const renderTrainingJobs = () => {
const lineageTrainingJobs = model?.properties?.mlModelLineageInfo?.trainingJobs || [];
console.log("lineageTrainingJobs", model?.properties?.mlModelLineageInfo?.trainingJobs);

if (lineageTrainingJobs.length === 0) return '-';

// TODO: get job name from job URN
return lineageTrainingJobs.map((jobUrn, index) => (
<div key={jobUrn}>
<JobLink to={entityRegistry.getEntityUrl(EntityType.DataProcessInstance, jobUrn)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export default function MLGroupModels() {
return new Date(milliseconds).toISOString().slice(0, 19).replace('T', ' ');
};

console.log("modelGroup", modelGroup);
console.log("models", models);
console.log("model properties", models[0].properties.customProperties[0]);

const columns = [
{
Expand All @@ -127,32 +127,32 @@ export default function MLGroupModels() {
),
},
{
title: 'Registered At',
key: 'date',
title: 'Created At',
key: 'createdAt',
width: 150,
render: (_: any, record: EntityType.Mlmodel) => (
<Typography.Text>{formatDate(record.properties?.date)}</Typography.Text>
<Typography.Text>{formatDate(record.properties?.created?.time)}</Typography.Text>
),
},
// use versionProperties for aliases
// {
// title: 'Aliases',
// key: 'aliases',
// width: 200,
// render: (_: any, record: EntityType.Mlmodel) => {
// const aliases = record.versionProperties?.aliases?.map(va => va.aliasVersion) || [];

// return (
// <TagContainer>
// {aliases.map((alias) => (
// <AliasePill>
// {alias}
// </AliasePill>
// ))}
// </TagContainer>
// );
// },
// },
{
title: 'Aliases',
key: 'aliases',
width: 200,
render: (_: any, record: EntityType.Mlmodel) => {
const aliases = record.versionProperties?.aliases?.map(va => va.aliasVersion) || [];

return (
<TagContainer>
{aliases.map((alias) => (
<AliasePill>
{alias}
</AliasePill>
))}
</TagContainer>
);
},
},
{
title: 'Tags',
key: 'tags',
Expand Down Expand Up @@ -194,10 +194,10 @@ export default function MLGroupModels() {
<Typography.Title level={3}>Model Group Details</Typography.Title>
<InfoItemContainer justifyContent="left">
<InfoItem title="Created At">
<InfoItemContent>{modelGroup?.properties?.created?.time ? formatDate(modelGroup.properties.createdAt) : '-'}</InfoItemContent>
<InfoItemContent>{modelGroup?.properties?.created?.time ? formatDate(modelGroup.properties?.created?.time) : '-'}</InfoItemContent>
</InfoItem>
<InfoItem title="Last Modified At">
<InfoItemContent>{modelGroup?.properties?.lastModified?.time ? formatDate(modelGroup.properties.lastModified) : '-'}</InfoItemContent>
<InfoItemContent>{modelGroup?.properties?.lastModified?.time ? formatDate(modelGroup.properties?.lastModified?.time) : '-'}</InfoItemContent>
</InfoItem>
{modelGroup?.properties?.created?.actor && (
<InfoItem title="Created By">
Expand Down
18 changes: 18 additions & 0 deletions datahub-web-react/src/graphql/lineage.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ fragment lineageNodeProperties on EntityWithRelationships {
name
description
origin
tags {
...globalTagsFields
}
platform {
...platformFields
}
Expand All @@ -305,6 +308,21 @@ fragment lineageNodeProperties on EntityWithRelationships {
status {
removed
}
properties {
createdTS: created {
time
actor
}
modelVersion: version
tags
customProperties {
key
value
}
}
editableProperties {
description
}
structuredProperties {
properties {
...structuredPropertiesFields
Expand Down
17 changes: 17 additions & 0 deletions datahub-web-react/src/graphql/mlModel.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ query getMLModel($urn: String!) {
}
}
}
trainedBy: relationships(input: { types: ["TrainedBy"], direction: OUTGOING, start: 0, count: 100 }) {
start
count
total
relationships {
type
direction
entity {
... on DataProcessInstance {
urn
name
type
...dataProcessInstanceFields
}
}
}
}
privileges {
...entityPrivileges
}
Expand Down
Loading

0 comments on commit 43e3d07

Please sign in to comment.