dstandish commented on code in PR #27428:
URL: https://github.com/apache/airflow/pull/27428#discussion_r1013265294


##########
airflow/api_connexion/schemas/task_instance_schema.py:
##########
@@ -33,6 +33,14 @@
 from airflow.utils.state import State
 
 
+class _ExecutorConfigField(fields.String):
+    def _serialize(self, value, attr, obj, **kwargs):
+        try:
+            return super()._serialize(value, attr, obj, **kwargs)
+        except Exception:
+            return "{}"

Review Comment:
   ```suggestion
           with suppress():
               return super()._serialize(value, attr, obj, **kwargs)
   ```
   
   (must be imported from contextlib)
   
   Perhaps in this case it's best not to return empty dict because.... we 
actually don't know what it was, and saying it's empty dict is a lie.  we could 
even instead return '<failed to serialize>' or something. but the above 
suggestion just returns None.... i'm not sure if that's handled well 
downstream.  but you could try it.
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to