)]}'
{
  "commit": "d4a32bbc878669e73fba7bf27c467319fbdd7d5a",
  "tree": "26b96f6082371a2508ab36d0b2bb5f29a60120c2",
  "parents": [
    "fa858b82d2eea36ce5cb370f1ae30ce2e82c022e"
  ],
  "author": {
    "name": "Tony Liao",
    "email": "tonyliaoss@google.com",
    "time": "Thu Oct 03 10:50:37 2024 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Thu Oct 03 10:55:13 2024 -0700"
  },
  "message": "Add test cases for empty map entries for text format in Python.\n\nThis is just part of an effort at locking down (and understand well) how map\nentries are serialized into textproto when they have empty fields.\n\nRight now the C++ behaviour for DynamicMessages is that for implicit-presence\n(i.e. \"proto3\") fields, the empty MapEntry fields are not serialized even if\nexplicitly set. For example, `value: \"\"` would not show up in textproto\nserialization for proto3 MapEntry messages. This contrasts with C++ map\nreflection behaviour, because C++ MapEntry messages are always generated with\nhasbits (even if they are declared in a proto3 file and have implicit presence\naccording to their descriptors).\n\nFor this Python test, the DynamicMessage fallback path was triggered because\nthe implementation of the C++ proto was not found. When python is lacking in\nimplementation, it calls DynamicMessage which respects field presence, even for\nmap entries. If the corresponding `map_unittest_cc_proto` is linked, this test\nactually fails, because the C++ MapEntry implementation, which is always\ngenerated with hasbits even for implicit presence, is used.\n\nPiperOrigin-RevId: 681944020\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "af29054ac51f1a8f1e75ad4bdb9488d332c1d970",
      "old_mode": 33188,
      "old_path": "python/google/protobuf/internal/text_format_test.py",
      "new_id": "b8c8331837a5cdf56364e23efc3ca8f7a1af2dfe",
      "new_mode": 33188,
      "new_path": "python/google/protobuf/internal/text_format_test.py"
    }
  ]
}
