Skip to content

Commit 4af4990

Browse files
authored
chore(texttosql): codeql findings (#701)
1 parent e641461 commit 4af4990

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

Diff for: lambda/aws-text-to-sql/query_executor/db_helper.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def get_db_connection(db_name):
3535
db_name = credentials['dbname']
3636
db_uri = f"mysql+pymysql://{db_user}:{db_password}@{db_host}/{db_name}"
3737

38-
print(f"db_uri :: {db_uri}")
3938
return SQLDatabase.from_uri(db_uri, sample_rows_in_table_info=3)
4039

4140

@@ -56,13 +55,10 @@ def get_secret():
5655
get_secret_value_response = client.get_secret_value(
5756
SecretId=secret_arn
5857
)
59-
60-
print(f"get_secret_value_response :: {get_secret_value_response}")
6158

6259
if 'SecretString' in get_secret_value_response:
6360
secret = get_secret_value_response['SecretString']
6461
else:
6562
logger.error("Error: Unable to retrieve texttosqldbsecret value")
66-
67-
logger.info(f'secret :: {secret}')
63+
6864
return json.loads(secret)

Diff for: lambda/aws-text-to-sql/query_generator/db_helper.py

-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def get_db_connection(db_name):
3535
db_name = credentials['dbname']
3636
db_uri = f"mysql+pymysql://{db_user}:{db_password}@{db_host}/{db_name}"
3737

38-
print(f"db_uri :: {db_uri}")
3938
return SQLDatabase.from_uri(db_uri, sample_rows_in_table_info=3)
4039

4140

@@ -52,12 +51,9 @@ def get_secret():
5251
region_name=session.region_name
5352
)
5453

55-
print(f"secret_arn :: {secret_arn}")
5654
get_secret_value_response = client.get_secret_value(
5755
SecretId=secret_arn
5856
)
59-
60-
print(f"get_secret_value_response :: {get_secret_value_response}")
6157

6258
if 'SecretString' in get_secret_value_response:
6359
secret = get_secret_value_response['SecretString']

0 commit comments

Comments
 (0)