forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing ml model feature tab (datahub-project#4769)
- Loading branch information
1 parent
cdfe3d1
commit e4389b7
Showing
1 changed file
with
2 additions
and
5 deletions.
There are no files selected for viewing
7 changes: 2 additions & 5 deletions
7
datahub-web-react/src/app/entity/mlModel/profile/MlModelFeaturesTab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
import React from 'react'; | ||
|
||
import { EntityType } from '../../../../types.generated'; | ||
import { useEntityRegistry } from '../../../useEntityRegistry'; | ||
import { useBaseEntity } from '../../shared/EntityContext'; | ||
import { GetMlModelQuery } from '../../../../graphql/mlModel.generated'; | ||
import { EntityList } from '../../shared/tabs/Entity/components/EntityList'; | ||
|
||
export default function MlModelFeaturesTab() { | ||
const entity = useBaseEntity() as GetMlModelQuery; | ||
const entityRegistry = useEntityRegistry(); | ||
|
||
const model = entity && entity.mlModel; | ||
const featureTables = model?.features?.relationships.map((relationship) => relationship.entity); | ||
const features = model?.features?.relationships.map((relationship) => relationship.entity); | ||
|
||
const title = `Part of ${entityRegistry.getEntityName(EntityType.MlfeatureTable)}`; | ||
return <EntityList title={title} type={EntityType.MlfeatureTable} entities={featureTables || []} />; | ||
return <EntityList title="Features used" type={EntityType.Mlfeature} entities={features || []} />; | ||
} |