You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/09 12:21:25 UTC

[GitHub] [airflow] tirkarthi commented on a diff in pull request #27428: Handle exception during serializing incompatible executor_config object.

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


##########
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:
   I guess I received an error since this is not nullable in API spec and should be a string. I agree if there is a definite way to signal error in the string I would be happy to make the changes. https://github.com/apache/airflow/blob/2f5c77b0baa0ab26d2c51fa010850653ded80a46/airflow/api_connexion/openapi/v1.yaml#L3235-L3236



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org