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/12/17 21:47:42 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #20358: Fix remaining MyPy errors in Google Provider

potiuk commented on a change in pull request #20358:
URL: https://github.com/apache/airflow/pull/20358#discussion_r771710200



##########
File path: airflow/providers/google/cloud/hooks/compute.py
##########
@@ -405,10 +405,11 @@ def get_instance_address(
         instance_info = self.get_instance_info(project_id=project_id, resource_id=resource_id, zone=zone)
         if use_internal_ip:
             return instance_info["networkInterfaces"][0].get("networkIP")
-
-        access_config = instance_info.get("networkInterfaces")[0].get("accessConfigs")
-        if access_config:
-            return access_config[0].get("natIP")
+        network_interfaces = instance_info.get("networkInterfaces")
+        if network_interfaces:
+            access_config = network_interfaces[0].get("accessConfigs")
+            if access_config:
+                return access_config[0].get("natIP")

Review comment:
       Why? I really would like to have some of those concepts in PEP 505 implemented. Are there good reasons it's not?




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