Skip to content

Commit f91dc0e

Browse files
jerivejerome-viveret-onfidoadchia
authored andcommitted
chore: Replace zod by protobufjs (#3208)
* feat: Replace zod by protobufjs Signed-off-by: Jérôme Viveret <[email protected]> Signed-off-by: Danny Chiao <[email protected]> * Remove unneeded pages and fix bugs Signed-off-by: Danny Chiao <[email protected]> * Update the ui_server Signed-off-by: Danny Chiao <[email protected]> * Replace manually generated json registry by protobuf version Signed-off-by: Danny Chiao <[email protected]> * Correctly display protobufjs enums Signed-off-by: Danny Chiao <[email protected]> Signed-off-by: Jérôme Viveret <[email protected]> Signed-off-by: Danny Chiao <[email protected]> Co-authored-by: Jérôme Viveret <[email protected]> Co-authored-by: Danny Chiao <[email protected]>
1 parent 7fa4bbf commit f91dc0e

File tree

67 files changed

+693
-1980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+693
-1980
lines changed

protos/feast/core/DataSource.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ option java_outer_classname = "DataSourceProto";
2323
option java_package = "feast.proto.core";
2424

2525
import "google/protobuf/duration.proto";
26+
import "google/protobuf/timestamp.proto";
2627
import "feast/core/DataFormat.proto";
2728
import "feast/types/Value.proto";
2829
import "feast/core/Feature.proto";
@@ -89,6 +90,12 @@ message DataSource {
8990
// Optional batch source for streaming sources for historical features and materialization.
9091
DataSource batch_source = 26;
9192

93+
SourceMeta meta = 50;
94+
95+
message SourceMeta {
96+
google.protobuf.Timestamp earliestEventTimestamp = 1;
97+
google.protobuf.Timestamp latestEventTimestamp = 2;
98+
}
9299

93100
// Defines options for DataSource that sources features from a file
94101
message FileOptions {

sdk/python/feast/ui/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ It is used by the `feast ui` command to scaffold a local UI server. The feast py
2222
The `feast ui` command will generate the necessary `projects-list.json` file and initialize it for the UI to read.
2323

2424

25-
**Note**: yarn start will not work on this because of the above dependency.
25+
**Note**: `yarn start` will not work on this because of the above dependency.
26+
27+
## Dev
28+
To test, do `yarn link` in ui/ and then come here to do `yarn link @feast-dev/feast`

sdk/python/feast/ui/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"@elastic/datemath": "^5.0.3",
7-
"@elastic/eui": "^57.0.0",
7+
"@elastic/eui": "^55.0.1",
88
"@emotion/react": "^11.9.0",
99
"@feast-dev/feast-ui": "latest",
1010
"@testing-library/jest-dom": "^5.16.4",
@@ -16,11 +16,11 @@
1616
"moment": "^2.29.4",
1717
"prop-types": "^15.8.1",
1818
"query-string": "^7.1.1",
19-
"react": "^18.1.0",
20-
"react-dom": "^18.1.0",
21-
"react-query": "^3.39.0",
22-
"react-router-dom": "^6.3.0",
23-
"react-scripts": "5.0.1",
19+
"react": "^17.0.2",
20+
"react-dom": "^17.0.2",
21+
"react-query": "^3.34.12",
22+
"react-router-dom": "6",
23+
"react-scripts": "^5.0.0",
2424
"typescript": "^4.6.4",
2525
"use-query-params": "^1.2.3",
2626
"web-vitals": "^2.1.4",

sdk/python/feast/ui/yarn.lock

Lines changed: 19 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,51 +1202,6 @@
12021202
uuid "^8.3.0"
12031203
vfile "^4.2.0"
12041204

1205-
"@elastic/eui@^57.0.0":
1206-
version "57.0.0"
1207-
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-57.0.0.tgz#86d43e27196f9997ef44d2a4c701d092ce99e132"
1208-
integrity sha512-VBgW6Pr0JJB3JhJ59MV8guxb2v4Gd3SJEmsMGKGyIY+KcvSMWbVEGa44Ep12VAJYynIA05Z3OXXc/ge5dMycpA==
1209-
dependencies:
1210-
"@types/chroma-js" "^2.0.0"
1211-
"@types/lodash" "^4.14.160"
1212-
"@types/numeral" "^0.0.28"
1213-
"@types/react-beautiful-dnd" "^13.1.2"
1214-
"@types/react-input-autosize" "^2.2.1"
1215-
"@types/react-virtualized-auto-sizer" "^1.0.1"
1216-
"@types/react-window" "^1.8.5"
1217-
"@types/refractor" "^3.0.0"
1218-
"@types/resize-observer-browser" "^0.1.5"
1219-
"@types/vfile-message" "^2.0.0"
1220-
chroma-js "^2.1.0"
1221-
classnames "^2.2.6"
1222-
lodash "^4.17.21"
1223-
mdast-util-to-hast "^10.0.0"
1224-
numeral "^2.0.6"
1225-
prop-types "^15.6.0"
1226-
react-beautiful-dnd "^13.1.0"
1227-
react-dropzone "^11.5.3"
1228-
react-element-to-jsx-string "^14.3.4"
1229-
react-focus-on "^3.5.4"
1230-
react-input-autosize "^3.0.0"
1231-
react-is "^17.0.2"
1232-
react-virtualized-auto-sizer "^1.0.6"
1233-
react-window "^1.8.6"
1234-
refractor "^3.5.0"
1235-
rehype-raw "^5.0.0"
1236-
rehype-react "^6.0.0"
1237-
rehype-stringify "^8.0.0"
1238-
remark-breaks "^2.0.2"
1239-
remark-emoji "^2.1.0"
1240-
remark-parse "^8.0.3"
1241-
remark-rehype "^8.0.0"
1242-
tabbable "^5.2.1"
1243-
text-diff "^1.0.1"
1244-
unified "^9.2.0"
1245-
unist-util-visit "^2.0.3"
1246-
url-parse "^1.5.10"
1247-
uuid "^8.3.0"
1248-
vfile "^4.2.0"
1249-
12501205
"@emotion/babel-plugin@^11.7.1":
12511206
version "11.9.2"
12521207
resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz#723b6d394c89fb2ef782229d92ba95a740576e95"
@@ -8403,13 +8358,14 @@ react-dev-utils@^12.0.1:
84038358
strip-ansi "^6.0.1"
84048359
text-table "^0.2.0"
84058360

8406-
react-dom@^18.1.0:
8407-
version "18.1.0"
8408-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.1.0.tgz#7f6dd84b706408adde05e1df575b3a024d7e8a2f"
8409-
integrity sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w==
8361+
react-dom@^17.0.2:
8362+
version "17.0.2"
8363+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
8364+
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
84108365
dependencies:
84118366
loose-envify "^1.1.0"
8412-
scheduler "^0.22.0"
8367+
object-assign "^4.1.1"
8368+
scheduler "^0.20.2"
84138369

84148370
react-dropzone@^11.5.3:
84158371
version "11.7.1"
@@ -8481,7 +8437,7 @@ react-is@^18.0.0:
84818437
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67"
84828438
integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg==
84838439

8484-
react-query@^3.34.12, react-query@^3.39.0:
8440+
react-query@^3.34.12:
84858441
version "3.39.0"
84868442
resolved "https://registry.yarnpkg.com/react-query/-/react-query-3.39.0.tgz#0caca7b0da98e65008bbcd4df0d25618c2100050"
84878443
integrity sha512-Od0IkSuS79WJOhzWBx/ys0x13+7wFqgnn64vBqqAAnZ9whocVhl/y1padD5uuZ6EIkXbFbInax0qvY7zGM0thA==
@@ -8526,7 +8482,7 @@ react-remove-scroll@^2.5.2:
85268482
use-callback-ref "^1.3.0"
85278483
use-sidecar "^1.1.2"
85288484

8529-
react-router-dom@6, react-router-dom@^6.3.0:
8485+
react-router-dom@6:
85308486
version "6.3.0"
85318487
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.3.0.tgz#a0216da813454e521905b5fa55e0e5176123f43d"
85328488
integrity sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==
@@ -8541,7 +8497,7 @@ [email protected]:
85418497
dependencies:
85428498
history "^5.2.0"
85438499

8544-
react-scripts@5.0.1, react-scripts@^5.0.0:
8500+
react-scripts@^5.0.0:
85458501
version "5.0.1"
85468502
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-5.0.1.tgz#6285dbd65a8ba6e49ca8d651ce30645a6d980003"
85478503
integrity sha512-8VAmEm/ZAwQzJ+GOMLbBsTdDKOpuZh7RPs0UymvBR2vRk4iZWCskjbFnxqjrzoIvlNNRZ3QJFx6/qDSi6zSnaQ==
@@ -8618,12 +8574,13 @@ react-window@^1.8.6:
86188574
"@babel/runtime" "^7.0.0"
86198575
memoize-one ">=3.1.1 <6"
86208576

8621-
react@^18.1.0:
8622-
version "18.1.0"
8623-
resolved "https://registry.yarnpkg.com/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890"
8624-
integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ==
8577+
react@^17.0.2:
8578+
version "17.0.2"
8579+
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
8580+
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
86258581
dependencies:
86268582
loose-envify "^1.1.0"
8583+
object-assign "^4.1.1"
86278584

86288585
readable-stream@^2.0.1:
86298586
version "2.3.7"
@@ -9001,12 +8958,13 @@ saxes@^5.0.1:
90018958
dependencies:
90028959
xmlchars "^2.2.0"
90038960

9004-
scheduler@^0.22.0:
9005-
version "0.22.0"
9006-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.22.0.tgz#83a5d63594edf074add9a7198b1bae76c3db01b8"
9007-
integrity sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ==
8961+
scheduler@^0.20.2:
8962+
version "0.20.2"
8963+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
8964+
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
90088965
dependencies:
90098966
loose-envify "^1.1.0"
8967+
object-assign "^4.1.1"
90108968

90118969
90128970
version "2.7.0"

sdk/python/feast/ui_server.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ def get_app(
3030
)
3131

3232
# Asynchronously refresh registry, notifying shutdown and canceling the active timer if the app is shutting down
33-
registry_json = ""
33+
registry_proto = None
3434
shutting_down = False
3535
active_timer: Optional[threading.Timer] = None
3636

3737
def async_refresh():
3838
store.refresh_registry()
39-
nonlocal registry_json
40-
registry_json = get_registry_dump(store.config, store.repo_path)
39+
nonlocal registry_proto
40+
registry_proto = store.registry.proto()
4141
if shutting_down:
4242
return
4343
nonlocal active_timer
@@ -70,7 +70,10 @@ def shutdown_event():
7070

7171
@app.get("/registry")
7272
def read_registry():
73-
return json.loads(registry_json)
73+
return Response(
74+
content=registry_proto.SerializeToString(),
75+
media_type="application/octet-stream",
76+
)
7477

7578
# For all other paths (such as paths that would otherwise be handled by react router), pass to React
7679
@app.api_route("/p/{path_name:path}", methods=["GET"])

ui/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/protos.d.ts
2+
src/protos.js

ui/feature_repo/test_get_features.py

Lines changed: 0 additions & 86 deletions
This file was deleted.

ui/package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"react-router-dom": "6",
2626
"react-scripts": "^5.0.0",
2727
"typescript": "^4.4.2",
28-
"use-query-params": "^1.2.3",
29-
"zod": "^3.11.6"
28+
"use-query-params": "^1.2.3"
3029
},
3130
"dependencies": {
3231
"@elastic/datemath": "^5.0.3",
@@ -41,20 +40,21 @@
4140
"inter-ui": "^3.19.3",
4241
"moment": "^2.29.1",
4342
"prop-types": "^15.8.1",
43+
"protobufjs": "^7.1.1",
4444
"query-string": "^7.1.1",
4545
"react-query": "^3.34.12",
4646
"react-router-dom": "6",
4747
"react-scripts": "^5.0.0",
48-
"use-query-params": "^1.2.3",
49-
"zod": "^3.11.6"
48+
"use-query-params": "^1.2.3"
5049
},
5150
"scripts": {
52-
"start": "react-scripts start",
53-
"build": "react-scripts build",
54-
"build:lib": "rimraf ./dist && tsc && rollup -c",
55-
"build:lib-dev": "rimraf ./dist && tsc && rollup -c && yalc publish -f",
56-
"test": "react-scripts test",
57-
"eject": "react-scripts eject"
51+
"start": "npm run generate-protos && react-scripts start",
52+
"build": "npm run generate-protos && react-scripts build",
53+
"build:lib": "npm run generate-protos && rimraf ./dist && tsc && rollup -c",
54+
"build:lib-dev": "npm run generate-protos && rimraf ./dist && tsc && rollup -c && yalc publish -f",
55+
"test": "npm run generate-protos && react-scripts test",
56+
"eject": "react-scripts eject",
57+
"generate-protos": "pbjs --no-encode -o src/protos.js -w commonjs -t static-module `find ../protos/feast/ -iname *.proto` && pbts -n protos -o src/protos.d.ts src/protos.js"
5858
},
5959
"eslintConfig": {
6060
"extends": [
@@ -92,6 +92,7 @@
9292
"@testing-library/react": "^12.0.0",
9393
"@testing-library/user-event": "^13.2.1",
9494
"msw": "^0.36.8",
95+
"protobufjs-cli": "^1.0.2",
9596
"react": "^17.0.2",
9697
"react-dom": "^17.0.2",
9798
"rimraf": "^3.0.2",

ui/public/projects-list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Credit Score Project",
55
"description": "Project for credit scoring team and associated models.",
66
"id": "credit_score_project",
7-
"registryPath": "/registry.json"
7+
"registryPath": "/registry.db"
88
},
99
{
1010
"name": "Empty Registry",

ui/public/registry.db

5.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)