Skip to content
Merged
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
Next Next commit
update source
Signed-off-by: hao-affirm <104030690+hao-affirm@users.noreply.github.com>
  • Loading branch information
hao-affirm committed Sep 27, 2022
commit 5fb4833a4c94f0f27d3c4df9421c6a74ac240d45
41 changes: 5 additions & 36 deletions ui/src/parsers/feastSFVS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,8 @@ const FeatureViewProjectionSchema = z.object({
}),
});

const RequestDataSourceSchema = z.object({
requestDataSource: z.object({
type: z.string(),
name: z.string(),
requestDataOptions: z.object({
schema: z.array(FeastFeatureColumnSchema),
}),
}),
});

const StreamDataSourceSchema = z.object({
streamDataSource: z.object({
const StreamSourceSchema = z.object({
streamSource: z.object({
type: z.string(),
name: z.string(),
streamDataOptions: z.object({
Expand All @@ -28,32 +18,11 @@ const StreamDataSourceSchema = z.object({
}),
});

const ODFVInputsSchema = z.union([
FeatureViewProjectionSchema,
StreamDataSourceSchema,
]);

const SFVInputsSchema = z.union([
FeatureViewProjectionSchema,
StreamDataSourceSchema,
StreamSourceSchema,
]);

const FeastODFVSchema = z.object({
spec: z.object({
name: z.string(),
features: z.array(FeastFeatureColumnSchema),
sources: z.record(ODFVInputsSchema),
userDefinedFunction: z.object({
name: z.string(),
body: z.string(),
}),
}),
meta: z.object({
createdTimestamp: z.string().transform((val) => new Date(val)),
lastUpdatedTimestamp: z.string().transform((val) => new Date(val)),
}),
});

const FeastSFVSchema = z.object({
spec: z.object({
name: z.string(),
Expand All @@ -71,7 +40,7 @@ const FeastSFVSchema = z.object({
});

type FeastSFVType = z.infer<typeof FeastSFVSchema>;
type StreamDataSourceType = z.infer<typeof StreamDataSourceSchema>;
type StreamSourceType = z.infer<typeof StreamSourceSchema>;

export { FeastSFVSchema };
export type { FeastSFVType, StreamDataSourceType};
export type { FeastSFVType, StreamSourceType};