You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "moiseenkov (via GitHub)" <gi...@apache.org> on 2023/06/14 14:02:23 UTC

[GitHub] [airflow] moiseenkov opened a new pull request, #31901: Refactor GKECreateClusterOperator's body validation

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

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


[GitHub] [airflow] moiseenkov closed pull request #31901: Refactor GKECreateClusterOperator's body validation

Posted by "moiseenkov (via GitHub)" <gi...@apache.org>.
moiseenkov closed pull request #31901: Refactor GKECreateClusterOperator's body validation
URL: https://github.com/apache/airflow/pull/31901


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