jroachgolf84 commented on code in PR #53138:
URL: https://github.com/apache/airflow/pull/53138#discussion_r2198091120


##########
providers/google/src/airflow/providers/google/cloud/hooks/bigquery.py:
##########
@@ -2055,22 +2056,31 @@ def _format_schema_for_description(schema: dict) -> 
list:
     """
     Reformat the schema to match cursor description standard.
 
-    The description should be a tuple of 7 elemenbts: name, type, display_size,
+    The description should be a tuple of 7 elements: name, type, display_size,
     internal_size, precision, scale, null_ok.
     """
     description = []
-    for field in schema["fields"]:
+
+    if not schema or not isinstance(schema, dict):
+        return description
+
+    fields = schema.get("fields")

Review Comment:
   This logic seems redundant. We've already determined that `schema` is a 
dictionary and that `fields` is a key in that dictionary. I think it's best to 
only choose one place to implement this logic.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to