Skip to content

Commit

Permalink
fixing ml model feature tab (datahub-project#4769)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-lyons authored and maggiehays committed Aug 1, 2022
1 parent cdfe3d1 commit e4389b7
Showing 1 changed file with 2 additions and 5 deletions.
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 || []} />;
}

0 comments on commit e4389b7

Please sign in to comment.