Closed darrenwjones closed 3 months ago
Looking at the commit that was merged to fix AppendRowsStream, I tried to implement the same changes by adding the following code between copying the descriptor and setting the descriptor in the schema
pb2_descriptor.CopyToProto(proto_descriptor)
# ------ new code ------
for field in proto_descriptor.field:
field.ClearField("oneof_index")
field.ClearField("proto3_optional")
proto_descriptor.ClearField("oneof_decl")
# ------ end new code ------
proto_schema.proto_descriptor = proto_descriptor
I also tried adding the code after creating the AppendRowsRequest Although neither of these changes seem to fix my issue
I fixed this issue when realizing my fields had nested fields and thus I wasn't clearing all the fields appropriately. After the CopyToProto I cleared all the fields of proto3 syntax by using a function like so
def _clear_proto3_in_descriptor(descriptor):
for field in descriptor.field:
field.ClearField("oneof_index")
field.ClearField("proto3_optional")
descriptor.ClearField("oneof_decl")
for nested_type in descriptor.nested_type:
_clear_proto3_in_descriptor(nested_type)
Continuation of this issue as it seems this fix is only applying to the AppendRowsStream which, to my understanding, is depreciated in favor of append_rows
Environment details
Steps to reproduce
Code example
Stack trace