Skip to content

Commit

Permalink
Do not log the hook connection details even at DEBUG level (apache#22627
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 88165b3)
  • Loading branch information
collinmcnulty authored and jedcunningham committed Mar 31, 2022
1 parent e14cd18 commit 053e4eb
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions airflow/hooks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from airflow.typing_compat import Protocol
from airflow.utils.log.logging_mixin import LoggingMixin
from airflow.utils.log.secrets_masker import redact

if TYPE_CHECKING:
from airflow.models.connection import Connection # Avoid circular imports.
Expand Down Expand Up @@ -66,18 +65,7 @@ def get_connection(cls, conn_id: str) -> "Connection":
from airflow.models.connection import Connection

conn = Connection.get_connection_from_secrets(conn_id)
if conn.host:
log.info(
"Using connection to: id: %s. Host: %s, Port: %s, Schema: %s, Login: %s, Password: %s, "
"extra: %s",
conn.conn_id,
conn.host,
conn.port,
conn.schema,
conn.login,
redact(conn.password),
redact(conn.extra_dejson),
)
log.info("Using connection ID '%s' for task execution.", conn.conn_id)
return conn

@classmethod
Expand Down

0 comments on commit 053e4eb

Please sign in to comment.