Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions ui/src/models/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export interface FeatureAttributes {
name: string;
type: string;
transformation: FeatureTransformation;
definition: string;
def: FeatureDef;
"def.sqlExpr": string;
key: FeatureKey[];
window: string;
input_anchor_features: InputAnchorFeatures[];
input_derived_features: InputDerivedFeatures[]
Expand All @@ -42,12 +40,22 @@ export interface InputDerivedFeatures {
uniqueAttributes: FeatureAttributes;
}

export interface FeatureDef {
sqlExpr: string;
export interface FeatureTransformation {
transform_expr: string,
filter: string,
agg_func: string,
limit: string,
group_by: string,
window: string,
def_expr: string
}

export interface FeatureTransformation {
transform_expr: string
export interface FeatureKey {
full_name: string,
key_column: string,
description: string,
key_column_alias: string,
key_column_type: string
}

export interface IDataSource {
Expand Down
52 changes: 26 additions & 26 deletions ui/src/pages/feature/featureDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,56 +78,56 @@ const FeatureDetails: React.FC<Props> = () => {
const renderFeature = (feature: FeatureAttributes): JSX.Element => {
return (
<div className="site-card-wrapper">
<Row gutter={ 16 }>
{ feature?.type &&
<Row>
{ feature?.key && feature.key.length > 0 &&
<Col span={ 8 }>
<Card title="Type" bordered={ false }>
{ feature.type }
<Card title="Key" bordered={ false }>
<p>full_name: { feature.key[0].full_name }</p>
<p>key_column: { feature.key[0].key_column }</p>
<p>description: { feature.key[0].description }</p>
<p>key_column_alias: { feature.key[0].key_column_alias }</p>
<p>key_column_type: { feature.key[0].key_column_type }</p>
</Card>
</Col>
}
{ feature?.definition &&
{ feature?.type &&
<Col span={ 8 }>
<Card title="Definition" bordered={ false }>
{ feature.definition }
<Card title="Type" bordered={ false }>
{ feature.type }
</Card>
</Col>
}
{ feature?.def &&
{ feature?.transformation &&
<Col span={ 8 }>
<Card title="SQL Expression" bordered={ false }>
{ feature["def.sqlExpr"] }
<Card title="Transformation" bordered={ false }>
<p>transform_expr: { feature.transformation.transform_expr ?? "N/A" }</p>
<p>filter: { feature.transformation.filter ?? "N/A" }</p>
<p>agg_func: { feature.transformation.agg_func ?? "N/A" }</p>
<p>limit: { feature.transformation.limit ?? "N/A" }</p>
<p>group_by: { feature.transformation.group_by ?? "N/A" }</p>
<p>window: { feature.transformation.window ?? "N/A" }</p>
<p>def_expr: { feature.transformation.def_expr ?? "N/A" }</p>
</Card>
</Col>
}
</Row>
<Row>
{ feature?.input_anchor_features && feature?.input_anchor_features.length > 0 &&
<Col span={ 16 }>
<Col span={ 24 }>
<Card title="Input Anchor Features" bordered={ false }>
{ renderInputFeatureList(feature.input_anchor_features) }
</Card>
</Col>
}
</Row>
<Row>
{ feature?.input_derived_features && feature?.input_derived_features.length > 0 &&
<Col span={ 16 }>
<Col span={ 24 }>
<Card title="Input Derived Features" bordered={ false }>
{ renderInputFeatureList(feature.input_derived_features) }
</Card>
</Col>
}
{ feature?.transformation &&
<Col span={ 8 }>
<Card title="Transformation" bordered={ false }>
{ feature.transformation.transform_expr }
</Card>
</Col>
}
{ feature?.window &&
<Col span={ 8 }>
<Card title="Window" bordered={ false }>
{ feature.window }
</Card>
</Col>
}
</Row>
</div>
)
Expand Down