Open gforsyth opened 2 years ago
I'm not sure how to make this better. The intended path is (bytes/json ->) Python libprotobuf wrappers using known-good protos for protobuf-level error messages -> bytes -> Rust/prost wrappers. Namespaced Substrait protos provided by the user are not known-good -- if nothing else the version may differ -- so they are rejected; I'd consider that intender behavior, and what you considered to be a workaround the correct thing to do.
Semi-related; the validator should also be renamespacing the protos. Right now it only renamespaces them in the Python world (so everything is in substrait_validator), but not as far as the descriptor pool is concerned.
Minor annoyance with an easy workaround. The code in
load_plan
does anisinstance
check for asubstrait.plan_pb2.Plan
here: https://github.com/substrait-io/substrait-validator/blob/main/py/substrait_validator/__init__.py#L140-L154But if the producer of substrait has namespaced their install, then it fails that
isinstance
check and raises as Unsupported. Not sure the best way to handle theisinstance
check, but as a workaround, if I instead send in the bytes fromplan.SerializeToString()
everything works fine.