Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog
Improves the reader API for accessing protobuf messages which are generated from the Schema objects within the DecoderFactory.
Docs
None
Description
I am using protarrow and found myself having to search for the message class objects in the
DecoderFactory
for the example seen below. Note that, in my current project set up, I do not have the proto message classes as a submodule / dependency. Given that mcap stores the schemas themselves, that this feature adds a lot of value so that anyone can read the logs without having to include the pb messages in their project.The only way to access these currently is by accessing 'private' class members.
The change here is a quick fix but I imagine that this can be made more ergonomic with changes to the reader class itself (
python/mcap-protobuf-support/mcap_protobuf/reader.py
)I did no tests as this is very straight forward. This PR does not have to be merged though I think it's a perfect example as to how this API can be improved.
If this feature is of interest, let me know and we can discuss what methods could be of interest. It would be nice if the reader itself offered this API. That being said, for the reader base-class I am not sure if similar changes make sense.