feat(ml): show custom properties for MLFeatureTable in UI (#4706)

* feat(ml): show custom properties for MLFeatureTable in UI

* Make assignment conditional

* Fix lint
This commit is contained in:
David Sanchez 2022-04-21 19:30:49 +02:00 committed by GitHub
parent 8d036fa179
commit 788fb8f45b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package com.linkedin.datahub.graphql.types.mlmodel.mappers;
import com.linkedin.datahub.graphql.generated.MLFeature;
import com.linkedin.datahub.graphql.generated.MLFeatureTableProperties;
import com.linkedin.datahub.graphql.generated.MLPrimaryKey;
import com.linkedin.datahub.graphql.types.common.mappers.StringMapMapper;
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;
import lombok.NonNull;
@ -41,6 +42,10 @@ public class MLFeatureTablePropertiesMapper implements ModelMapper<com.linkedin.
.collect(Collectors.toList()));
}
if (mlFeatureTableProperties.hasCustomProperties()) {
result.setCustomProperties(StringMapMapper.map(mlFeatureTableProperties.getCustomProperties()));
}
return result;
}
}

View File

@ -6945,6 +6945,8 @@ description: String
mlFeatures: [MLFeature]
mlPrimaryKeys: [MLPrimaryKey]
customProperties: [StringMapEntry!]
}
type HyperParameterMap {

View File

@ -14,6 +14,7 @@ import { SidebarTagsSection } from '../shared/containers/profile/sidebar/Sidebar
import MlFeatureTableFeatures from './profile/features/MlFeatureTableFeatures';
import Sources from './profile/Sources';
import { DocumentationTab } from '../shared/tabs/Documentation/DocumentationTab';
import { PropertiesTab } from '../shared/tabs/Properties/PropertiesTab';
/**
* Definition of the DataHub MLFeatureTable entity.
@ -75,6 +76,10 @@ export class MLFeatureTableEntity implements Entity<MlFeatureTable> {
name: 'Sources',
component: Sources,
},
{
name: 'Properties',
component: PropertiesTab,
},
{
name: 'Documentation',
component: DocumentationTab,

View File

@ -498,6 +498,10 @@ fragment nonRecursiveMLFeatureTable on MLFeatureTable {
mlPrimaryKeys {
...nonRecursiveMLPrimaryKey
}
customProperties {
key
value
}
}
ownership {
...ownershipFields

View File

@ -18,6 +18,14 @@ describe('features', () => {
// feature & primary key sources are visible
cy.contains('SampleCypressHdfsDataset');
cy.contains('SampleCypressKafkaDataset');
// navigate to properties
cy.contains('Properties').click();
// custom properties are visible
cy.contains('status');
cy.contains('Created');
});
it('can visit feature page', () => {