moiseenkov opened a new pull request, #31901:
URL: https://github.com/apache/airflow/pull/31901

   Refactored `GKECreateClusterOperator`'s body validation:
   
   1. Separated validation logic from the field value retrieval logic by moving 
it out into a separate method:
   ```python
   def _body_field(self, field_name: str, default_value: Any = None) -> Any:
       """Extracts the value of the given field name."""
       if isinstance(self.body, dict):
           return self.body.get(field_name, default_value)
       else:
           return getattr(self.body, field_name, default_value)
   ``` 
   2. Separated validation of the body fields from each other.
   3. Added warning messages when deprecated fields are used.
   4. Current behavior of the operator wasn't changed.


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