dimon222 commented on a change in pull request #19815:
URL: https://github.com/apache/airflow/pull/19815#discussion_r757049653



##########
File path: airflow/providers/postgres/hooks/postgres.py
##########
@@ -184,7 +184,13 @@ def get_iam_token(self, conn: Connection) -> Tuple[str, 
str, int]:
             # Pull the custer-identifier from the beginning of the Redshift URL
             # ex. my-cluster.ccdre4hpd39h.us-east-1.redshift.amazonaws.com 
returns my-cluster
             cluster_identifier = conn.extra_dejson.get('cluster-identifier', 
conn.host.split('.')[0])
-            client = aws_hook.get_client_type('redshift')
+            session, endpoint_url = aws_hook._get_credentials()
+            client = session.client(
+                "redshift",
+                endpoint_url=endpoint_url,
+                config=aws_hook.config,
+                verify=aws_hook.verify,
+            )

Review comment:
       This changed the behavior for mocking
   
   We could try change in `test_get_conn_rds_iam_redshift`
   ```
   
@mock.patch('airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook.get_client_type')
   ```
   to
   ```
   
@mock.patch('airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook._get_credentials')
   ```
   




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