forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeastODFVS.ts
More file actions
47 lines (41 loc) · 1.31 KB
/
Copy pathfeastODFVS.ts
File metadata and controls
47 lines (41 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { z } from "zod";
import { FeastFeatureColumnSchema } from "./feastFeatureViews";
const FeatureViewProjectionSchema = z.object({
featureViewProjection: z.object({
featureViewName: z.string(),
featureColumns: z.array(FeastFeatureColumnSchema),
}),
});
const RequestDataSourceSchema = z.object({
requestDataSource: z.object({
type: z.string(),
name: z.string(),
requestDataOptions: z.object({
schema: z.array(FeastFeatureColumnSchema),
}),
}),
});
const ODFVInputsSchema = z.union([
FeatureViewProjectionSchema,
RequestDataSourceSchema,
]);
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)),
}),
});
type FeastODFVType = z.infer<typeof FeastODFVSchema>;
type RequestDataSourceType = z.infer<typeof RequestDataSourceSchema>;
type FeatureViewProjectionType = z.infer<typeof FeatureViewProjectionSchema>;
export { FeastODFVSchema };
export type { FeastODFVType, RequestDataSourceType, FeatureViewProjectionType };