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 2021/11/08 00:40:15 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #19105: Update taskinstance REST API schema to include dag_run_id field

mik-laj commented on a change in pull request #19105:
URL: https://github.com/apache/airflow/pull/19105#discussion_r744343850



##########
File path: airflow/api_connexion/schemas/task_instance_schema.py
##########
@@ -27,28 +28,34 @@
 from airflow.utils.state import State
 
 
-class TaskInstanceSchema(Schema):
+class TaskInstanceSchema(SQLAlchemySchema):
     """Task instance schema"""
 
-    task_id = fields.Str()
-    dag_id = fields.Str()
-    execution_date = fields.DateTime(validate=validate_istimezone)
-    start_date = fields.DateTime(validate=validate_istimezone)
-    end_date = fields.DateTime(validate=validate_istimezone)
-    duration = fields.Float()
-    state = TaskInstanceStateField()

Review comment:
       Here you deleted the validations of allowed states. This field should only allow values allowed by the OpenAPI specification.
   https://github.com/apache/airflow/blob/26ad55beb00f5a0915ba4bec541e3d67044834e9/airflow/api_connexion/openapi/v1.yaml#L3406-L3419




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