gapic-generator-python
gapic-generator-python copied to clipboard
Remove workaround in `google-cloud-trace` and `google-cloud-kms` and `google-cloud-dataflow-client`
- In
google-cloud-trace:typeis listed as a reserved term ingapic-generator-pythonhere. There is a client specific workaround in owlbot.py forgoogle-cloud-traceto reverttypeas a reserved term. We should consider removing the workaround, which will result in a breaking change forgoogle-cloud-trace. See https://github.com/googleapis/python-trace/blob/f7721b434e9aff0c70f237ec0a9319f0781513d6/owlbot.py#L39-L44
# Rename field `type_` to `type` in v1 and v2 to avoid breaking change
s.replace(
library / "google/**/types/*.py",
"type_",
"type"
)
- In
google-cloud-kms:formatis listed as a reserved term ingapic-generator-pythonhere. There is a client specific workaround in owlbot.py forgoogle-cloud-kmsto revertformatas a reserved term. We should consider removing the workaround, which will result in a breaking change forgoogle-cloud-kms. See https://github.com/googleapis/python-kms/blob/b4529cb815154a3674daa78f50dfcf47244190e7/owlbot.py#L47-L51
# Rename `format_` to `format` to avoid breaking change
s.replace(library / "**/*.py",
"format_",
"format"
)
Similarly,
set is not listed as a reserved term in gapic-generator-python here. There is a client specific workaround in owlbot.py for google-cloud-dataflow-client to add set as a reserved term. We should consider removing the workaround, which will result in a breaking change for google-cloud-dataflow-client.
See https://github.com/googleapis/python-dataflow-client/blob/7d8797710d717094b71250dabe9c50a1eaa5dea8/owlbot.py#L39-L45
# Work around to avoid a breaking change
# Replace `set` with `set_`
s.replace(
library / "google/cloud/dataflow_v1beta3/types/metrics.py",
"set \(google.protobuf.struct_pb2.Value\)",
"set_ (google.protobuf.struct_pb2.Value)",
)
I'm going to transfer this issue to gapic-generator-python to determine if there are other solutions before we take a breaking change in these libraries.