Skip to content

Commit

Permalink
Update gRPC and protobuf (#668)
Browse files Browse the repository at this point in the history
* Update gRPC and protobuf

[ML-6341](https://iguazio.atlassian.net/browse/ML-6341)

* Revert to Go 1.19

* Get it working

* Fix

* Regenerate python gRPC code

* Update python access to protobuf message to work with protobuf 4

* Specify protobuf requirement explicitly

* Remove reference to MessageMapContainer

* Fix test message

* Revert "Remove reference to MessageMapContainer"

* Fix Dockerfile to always build for linux and amd64
  • Loading branch information
gtopper authored Oct 30, 2024
1 parent 2aa51e7 commit 0ab4b63
Show file tree
Hide file tree
Showing 14 changed files with 2,404 additions and 3,861 deletions.
4 changes: 4 additions & 0 deletions backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"reflect"
"strings"
"sync"
"unicode"

"github.com/nuclio/logger"
"github.com/pkg/errors"
Expand Down Expand Up @@ -107,6 +108,9 @@ func ValidateRequest(backend string, request interface{}, allowedFields map[stri
for i := 0; i < reftype.NumField(); i++ {
field := reftype.Field(i)
fieldName := field.Name
if unicode.IsLower(rune(fieldName[0])) {
continue
}
fieldValue := reflect.ValueOf(request).Elem().FieldByName(fieldName).Interface()
zeroValue := reflect.Zero(field.Type).Interface()
if !globalRequestFieldsByRequestType[reftype][fieldName] && !allowedFields[fieldName] && !reflect.DeepEqual(fieldValue, zeroValue) {
Expand Down
5 changes: 2 additions & 3 deletions clients/py/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
googleapis-common-protos>=1.5.3
# grpcio-tools 1.34.0 must not be used as it segfaults (1.34.1 ok).
# grpcio-tools 1.49 raises protobuf version from 3.x to 4.x, which breaks compatibility.
grpcio-tools>=1.30,!=1.34.0,<1.49
grpcio-tools>=1.49
protobuf~=4.0
pandas>=0.23.4
requests>=2.19.1
2 changes: 1 addition & 1 deletion clients/py/tests/test_pbutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_encode_df():
names = [col.name for col in msg.columns]
assert set(names) == set(df.columns), 'columns mismatch'
assert not msg.indices, 'has index'
assert pbutils.pb2py(msg.labels) == labels, 'lables mismatch'
assert pbutils.pb2py(msg.labels) == labels, 'labels mismatch'

# Now with index
index_name = 'DATE'
Expand Down
2,067 changes: 80 additions & 1,987 deletions clients/py/v3io_frames/frames_pb2.py

Large diffs are not rendered by default.

Loading

0 comments on commit 0ab4b63

Please sign in to comment.