gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Remove workaround in `google-cloud-trace` and `google-cloud-kms` and `google-cloud-dataflow-client`

Open parthea opened this issue 2 years ago • 1 comments

  • In google-cloud-trace: type is listed as a reserved term in gapic-generator-python here. There is a client specific workaround in owlbot.py for google-cloud-trace to revert type as a reserved term. We should consider removing the workaround, which will result in a breaking change for google-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: format is listed as a reserved term in gapic-generator-python here. There is a client specific workaround in owlbot.py for google-cloud-kms to revert format as a reserved term. We should consider removing the workaround, which will result in a breaking change for google-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)",
    )

parthea avatar Oct 27 '23 00:10 parthea

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.

parthea avatar Nov 02 '23 11:11 parthea