Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Divyanshu-Patel committed Oct 4, 2024
1 parent f5288f4 commit 07bb44b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions soda/redshift/soda/data_sources/redshift_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
Expand Down

0 comments on commit 07bb44b

Please sign in to comment.