ephraimbuddy commented on issue #15072:
URL: https://github.com/apache/airflow/issues/15072#issuecomment-939243627


   Some possible areas to refactor:
   
   - [ ] Create a base schema that all schemas will inherit from.  See using 
enveloping 
https://marshmallow.readthedocs.io/en/stable/extending.html#example-enveloping 
and this closed PR: 
https://github.com/apache/airflow/pull/9147/files#diff-8a440cb9f6479c8a90ab5d1cb8ee15700d6938ef4ccc5ee894e320f719c08d6fR25.
 
   
   - [ ] In post/patch endpoints, we  : 
        ```python
       try:
           data = dagruns_batch_form_schema.load(body)
       except ValidationError as err:
           raise BadRequest(detail=str(err.messages))
       ```
   we could have a function that does this for us, so we could just do: `data = 
validateschema(schema, body, partial=False)`. 
   
   - [ ] See this comment: #14895#discussion_r600334911
   
   cc: @eladkal 
   
   @uranusjr you can add more to the list
   
   


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