amoghrajesh commented on code in PR #58300:
URL: https://github.com/apache/airflow/pull/58300#discussion_r2529931237


##########
providers/postgres/src/airflow/providers/postgres/hooks/postgres.py:
##########
@@ -574,7 +574,15 @@ def _get_openlineage_redshift_authority_part(self, 
connection) -> str:
         aws_conn_id = connection.extra_dejson.get("aws_conn_id", "aws_default")
 
         port = connection.port or 5439
-        cluster_identifier = connection.extra_dejson.get("cluster-identifier", 
connection.host.split(".")[0])
+        cluster_identifier = connection.extra_dejson.get("cluster-identifier")
+        if cluster_identifier is None and not connection.host:
+            raise ValueError(
+                "connection.host is required for Redshift OpenLineage 
authority "
+                "when cluster-identifier is not provided in connection extra"
+            )

Review Comment:
   ```suggestion
           if cluster_identifier is None and not connection.host:
               raise ValueError(
                   "connection host is required for Redshift OpenLineage when 
cluster-identifier is not set in extras."
               )
   ```



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