MINOR: Fix none password issue for mysql and postgresql databases (#17548)

* fix none password issue

* added warning
This commit is contained in:
Onkar Ravgan 2024-08-22 17:34:34 +05:30 committed by GitHub
parent 0d1b4e0747
commit bbe92e2af3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,6 +33,9 @@ from metadata.generated.schema.entity.services.connections.database.common.iamAu
from metadata.ingestion.connections.headers import inject_query_header_by_conn
from metadata.ingestion.connections.secrets import connection_with_options_secrets
from metadata.utils.constants import BUILDER_PASSWORD_ATTR
from metadata.utils.logger import cli_logger
logger = cli_logger()
@connection_with_options_secrets
@ -152,6 +155,9 @@ def _add_password(url: str, connection) -> str:
Region=connection.authType.awsConfig.awsRegion,
)
)
if not password:
logger.warning("No password has been provided in connection")
password = SecretStr("")
url += f":{quote_plus(password.get_secret_value())}"
return url