[bigquery] Fix message_to_dict
Fix bugs / add missing logic:
- save an enum value as a string
- do not ignore zero primitive values, including enums
- ignore fields of message types that would result in RECORD without sub-fields
- save google.protobuf.Struct as JSONPB string
- ignore empty arrays
Enhance tests to cover these cases.
Bug: 788034
Change-Id: Ibd0f2d9ddd9496f12865fb4cfc2e43e97c4268af
Reviewed-on: https://chromium-review.googlesource.com/936185
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Katie Thomas <katthomas@google.com>
Cr-Mirrored-From: https://chromium.googlesource.com/infra/infra
Cr-Mirrored-Commit: ae6e2a81ffd4fc0dfb180bf259afa1270c4d556d
4 files changed