eladkal commented on code in PR #43669:
URL: https://github.com/apache/airflow/pull/43669#discussion_r1829652752
##########
providers/src/airflow/providers/postgres/hooks/postgres.py:
##########
@@ -271,6 +273,22 @@ def get_iam_token(self, conn: Connection) -> tuple[str,
str, int]:
)
token = cluster_creds["DbPassword"]
login = cluster_creds["DbUser"]
+ elif conn.extra_dejson.get("redshift-serverless", False):
+ port = conn.port or 5439
+ # Pull the workgroup-name from the query params/extras, if not
there then pull it from the
+ # beginning of the Redshift URL
+ # ex. workgroup-name.ccdre4hpd39h.us-east-1.redshift.amazonaws.com
returns my-cluster
+ workgroup_name = conn.extra_dejson.get("workgroup-name",
conn.host.split(".")[0])
+ redshift_serverless_client = AwsBaseHook(
Review Comment:
Can you change the import of `AwsBaseHook` to raise
`AirflowOptionalProviderFeatureException` instead of `AirflowException`?
Example:
https://github.com/apache/airflow/blob/857ca4c06c9008593674cabdd28d3c30e3e7f97b/providers/src/airflow/providers/teradata/transfers/s3_to_teradata.py#L25-L30
--
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]