pabloem commented on a change in pull request #14237:
URL: https://github.com/apache/beam/pull/14237#discussion_r594656232



##########
File path: sdks/python/apache_beam/io/mongodbio.py
##########
@@ -264,9 +264,11 @@ def display_data(self):
     res['uri'] = _mask_uri_password(self.uri)
     res['database'] = self.db
     res['collection'] = self.coll
-    res['filter'] = json.dumps(self.filter)
+    res['filter'] = json.dumps(
+        self.filter, default=lambda x: 'not_serializable')

Review comment:
       What's usually not serializable? non-JSON Python objects? Perhaps you 
can try `lambda x: 'not serializable(%s)' % str(x)`?

##########
File path: sdks/python/apache_beam/io/mongodbio.py
##########
@@ -264,9 +264,11 @@ def display_data(self):
     res['uri'] = _mask_uri_password(self.uri)
     res['database'] = self.db
     res['collection'] = self.coll
-    res['filter'] = json.dumps(self.filter)
+    res['filter'] = json.dumps(
+        self.filter, default=lambda x: 'not_serializable')

Review comment:
       (This is not required. Only up to you. Would it help if we add a unit 
test?)




----------------------------------------------------------------
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]


Reply via email to