From 07bb44bfc931a42119fa8a4876c7426aeb373666 Mon Sep 17 00:00:00 2001 From: Divyanshu Patel Date: Fri, 4 Oct 2024 23:03:25 +0530 Subject: [PATCH] changes --- soda/redshift/soda/data_sources/redshift_data_source.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/soda/redshift/soda/data_sources/redshift_data_source.py b/soda/redshift/soda/data_sources/redshift_data_source.py index a0c9b01b6..a4fd7cb56 100644 --- a/soda/redshift/soda/data_sources/redshift_data_source.py +++ b/soda/redshift/soda/data_sources/redshift_data_source.py @@ -22,6 +22,8 @@ def __init__(self, logs: Logs, data_source_name: str, data_source_properties: di self.connect_timeout = data_source_properties.get("connection_timeout_sec") self.username = data_source_properties.get("username") self.password = data_source_properties.get("password") + self.dbuser = data_source_properties.get("dbuser") + self.dbname = data_source_properties.get("dbname") if not self.username or not self.password: aws_credentials = AwsCredentials( @@ -64,8 +66,8 @@ def __get_cluster_credentials(self, aws_credentials: AwsCredentials): ) cluster_name = self.host.split(".")[0] - username = self.username - db_name = self.database + username = self.dbuser if self.dbuser else self.username + db_name = self.dbname if self.dbname else self.database cluster_creds = client.get_cluster_credentials( DbUser=username, DbName=db_name, ClusterIdentifier=cluster_name, AutoCreate=False, DurationSeconds=3600 )