Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Correctly display protobufjs enums
Signed-off-by: Danny Chiao <danny@tecton.ai>
  • Loading branch information
jerive authored and adchia committed Oct 5, 2022
commit 408bd9c5368bf24294e1b217ba10bd0f4fb6742e
20 changes: 17 additions & 3 deletions ui/src/components/FeaturesInServiceDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ interface FeatureViewsListInterace {
featureViews: feast.core.IFeatureViewProjection[];
}

interface IFeatureColumnInService {
featureViewName: string;
name: string;
valueType: feast.types.ValueType.Enum;
}

const FeaturesInServiceList = ({ featureViews }: FeatureViewsListInterace) => {
const { projectName } = useParams();
const items: IFeatureColumnInService[] = featureViews.flatMap(featureView => featureView.featureColumns!.map(featureColumn => ({
featureViewName: featureView.featureViewName!,
name: featureColumn.name!,
valueType: featureColumn.valueType!,
})));

const columns = [
{
Expand All @@ -28,22 +39,25 @@ const FeaturesInServiceList = ({ featureViews }: FeatureViewsListInterace) => {
},
{
name: "Feature Column",
field: "featureColumn.name",
field: "name",
},
{
name: "Value Type",
field: "valueType",
render: (valueType: feast.types.ValueType.Enum) => {
return feast.types.ValueType.Enum[valueType];
},
},
];

const getRowProps = (item: feast.core.IFeatureViewProjection) => {
const getRowProps = (item: IFeatureColumnInService) => {
return {
"data-test-subj": `row-${item.featureViewName}`,
};
};

return (
<EuiBasicTable columns={columns} items={featureViews} rowProps={getRowProps} />
<EuiBasicTable columns={columns} items={items} rowProps={getRowProps} />
);
};

Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/FeaturesListDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const FeaturesList = ({
{
name: "Value Type",
field: "valueType",
render: (valueType: feast.types.ValueType.Enum) => {
return feast.types.ValueType.Enum[valueType];
},
},
];

Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/data-sources/BatchSourcePropertiesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const BatchSourcePropertiesView = (props: BatchSourcePropertiesViewProps) => {
<EuiDescriptionListDescription>
{batchSource.dataSourceClassType.split(".").at(-1)}
</EuiDescriptionListDescription>
) : batchSource.type ? (
) : feast.core.DataSource.SourceType[batchSource.type!] ? (
<EuiDescriptionListDescription>
{batchSource.type}
</EuiDescriptionListDescription>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/pages/data-sources/DataSourceOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import BatchSourcePropertiesView from "./BatchSourcePropertiesView";
import FeatureViewEdgesList from "../entities/FeatureViewEdgesList";
import RequestDataSourceSchemaTable from "./RequestDataSourceSchemaTable";
import useLoadDataSource from "./useLoadDataSource";
import { feast } from "../../protos";

const DataSourceOverviewTab = () => {
let { dataSourceName } = useParams();
Expand Down Expand Up @@ -57,7 +58,7 @@ const DataSourceOverviewTab = () => {
Source Type
</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
{data.type}
{feast.core.DataSource.SourceType[data.type]}
</EuiDescriptionListDescription>
</EuiDescriptionList>
</React.Fragment>
Expand Down
3 changes: 3 additions & 0 deletions ui/src/pages/data-sources/DataSourcesListingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const DatasourcesListingTable = ({
name: "Type",
field: "type",
sortable: true,
render: (valueType: feast.types.ValueType.Enum) => {
return feast.types.ValueType.Enum[valueType];
},
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ interface RequestDataSourceSchema {
}

const RequestDataSourceSchemaTable = ({ fields }: RequestDataSourceSchema) => {
console.log(fields);
const columns = [
{
name: "Field",
Expand All @@ -21,6 +20,9 @@ const RequestDataSourceSchemaTable = ({ fields }: RequestDataSourceSchema) => {
{
name: "Value Type",
field: "valueType",
render: (valueType: feast.types.ValueType.Enum) => {
return feast.types.ValueType.Enum[valueType];
},
},
];

Expand Down
4 changes: 2 additions & 2 deletions ui/src/pages/entities/EntitiesListingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const EntitiesListingTable = ({ entities }: EntitiesListingTableProps) => {
name: "Type",
field: "spec.valueType",
sortable: true,
render: (valueType: string) => {
return valueType;
render: (valueType: feast.types.ValueType.Enum) => {
return feast.types.ValueType.Enum[valueType];
},
},
{
Expand Down
3 changes: 2 additions & 1 deletion ui/src/pages/entities/EntityOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import FeatureViewEdgesList from "./FeatureViewEdgesList";
import useFeatureViewEdgesByEntity from "./useFeatureViewEdgesByEntity";
import useLoadEntity from "./useLoadEntity";
import { toDate } from "../../utils/timestamp";
import { feast } from "../../protos";

const EntityOverviewTab = () => {
let { entityName } = useParams();
Expand Down Expand Up @@ -63,7 +64,7 @@ const EntityOverviewTab = () => {

<EuiDescriptionListTitle>Value Type</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
{data?.spec?.valueType}
{feast.types.ValueType.Enum[data?.spec?.valueType!]}
</EuiDescriptionListDescription>
</EuiDescriptionList>
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ const FeatureViewProjectionDisplayPanel = (featureViewProjection: RequestDataDis
const columns = [
{
name: "Column Name",
field: "name",
field: "name"
},
{
name: "Type",
field: "valueType",
render: (valueType: any) => {
return feast.types.ValueType.Enum[valueType];
},
},
];

Expand Down
3 changes: 2 additions & 1 deletion ui/src/pages/features/FeatureOverviewTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import TagsDisplay from "../../components/TagsDisplay";
import React from "react";
import { useParams } from "react-router-dom";
import useLoadFeature from "./useLoadFeature";
import { feast } from "../../protos";

const FeatureOverviewTab = () => {
let { projectName, FeatureViewName, FeatureName } = useParams();
Expand Down Expand Up @@ -51,7 +52,7 @@ const FeatureOverviewTab = () => {

<EuiDescriptionListTitle>Value Type</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
{featureData?.valueType}
{feast.types.ValueType.Enum[featureData?.valueType!]}
</EuiDescriptionListDescription>

<EuiDescriptionListTitle>FeatureView</EuiDescriptionListTitle>
Expand Down