SDK-780: Add regenerated protobuf files, remove .proto definitions #45
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.
Regenerating the protobuf files also generates gRPC files for each .proto definition.
I was tempted to remove these, as we haven't used them previously (and I am still optn to this), but this would mean we'd be interfering with the protobuf generation step, and would also need to do this every time we regenerate the Python files.
This issue was created which references the creation of these files was an error, but they decided in there it's best to leave the files as is for them as
It's somewhat analogous to the API design decision of "if you write a function that returns a list of results, and a particular call of the function has no results, return an empty list rather than returning null and creating special cases for your users ".
Google seem to leave it in also- https://github.com/googleads/google-ads-python/blob/master/google/ads/google_ads/v1/proto/errors/extension_setting_error_pb2_grpc.py
Thoughts welcome!
Additionally, similar to in Ruby, the
__init__.py
file in attribute_public_api needed a modification to the sys.path, so that the classes are aware of each other. The alternative is using relative imports, but that would mean again modifying the generated files again.There is talk of including this as a command line option in the Python protobuf generator (protocolbuffers/protobuf#1491), but for now this seems to be the only option which won't require modifying generated files or adding an extra step in the generation process.