ibzib commented on a change in pull request #11696:
URL: https://github.com/apache/beam/pull/11696#discussion_r424767747
##########
File path: sdks/python/apache_beam/runners/job/utils.py
##########
@@ -23,14 +23,19 @@
from __future__ import absolute_import
import json
+import logging
from google.protobuf import json_format
from google.protobuf import struct_pb2
def dict_to_struct(dict_obj):
# type: (dict) -> struct_pb2.Struct
- return json_format.ParseDict(dict_obj, struct_pb2.Struct())
+ try:
+ return json_format.ParseDict(dict_obj, struct_pb2.Struct())
+ except json_format.ParseError:
+ logging.error('Failed to parse dict {0}'.format(dict_obj))
Review comment:
Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]