ivica-k commented on code in PR #32785:
URL: https://github.com/apache/airflow/pull/32785#discussion_r1272371045


##########
airflow/providers/amazon/aws/hooks/redshift_data.py:
##########
@@ -95,6 +100,12 @@ def execute_query(
 
         statement_id = resp["Id"]
 
+        if kwargs["ClusterIdentifier"] and kwargs["WorkgroupName"]:
+            raise ValueError("Specify either 'cluster_identifier' or 
'workgroup_name', not both.")
+
+        if not kwargs["ClusterIdentifier"] and not kwargs["WorkgroupName"]:

Review Comment:
   Thank you, addressed in 56cc6d8ea13031ca610250735c8b0071065b233f



##########
airflow/providers/amazon/aws/operators/redshift_data.py:
##########
@@ -113,12 +120,19 @@ def hook(self) -> RedshiftDataHook:
 
     def execute(self, context: Context) -> GetStatementResultResponseTypeDef | 
str:
         """Execute a statement against Amazon Redshift."""
+        if self.cluster_identifier and self.workgroup_name:
+            raise AirflowException("Specify either 'cluster_identifier' or 
'workgroup_name', not both.")
+
+        if not self.cluster_identifier and not self.workgroup_name:
+            raise AirflowException("Either 'cluster_identifier' or 
'workgroup_name' must be specified.")

Review Comment:
   Thank you, addressed in 56cc6d8ea13031ca610250735c8b0071065b233f



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