potiuk commented on code in PR #34260:
URL: https://github.com/apache/airflow/pull/34260#discussion_r1322444484


##########
airflow/providers/google/cloud/utils/field_validator.py:
##########
@@ -443,7 +443,7 @@ def validate(self, body_to_validate: dict) -> None:
                     and nested_union_spec.get("api_version") != 
self._api_version
                 ]
             )
-        for field_name in body_to_validate.keys():
+        for field_name in body_to_validate:

Review Comment:
   I think you will never get `None` in reality - this was really a defensive 
test. And `AttributeError` was just side effect of using `keys()` on None. 
   
   I think the right solution is:
   
   Add this:
   
   ``
   if body_to_validate is None:
      raise RuntimeError("The body passed here should never be `None`) 
   ```
   
   and catch the RuntimeError in this test.



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