diff --git a/.changes/unreleased/Fixes-20240709-190235.yaml b/.changes/unreleased/Fixes-20240709-190235.yaml new file mode 100644 index 0000000..2d4fa05 --- /dev/null +++ b/.changes/unreleased/Fixes-20240709-190235.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Do not cast unscrubbed values to a string +time: 2024-07-09T19:02:35.755277-06:00 +custom: + Author: dbeatty10 + Issue: "165" diff --git a/dbt_common/exceptions/base.py b/dbt_common/exceptions/base.py index 61bd97a..22cbb68 100644 --- a/dbt_common/exceptions/base.py +++ b/dbt_common/exceptions/base.py @@ -10,13 +10,13 @@ def env_secrets() -> List[str]: return [v for k, v in os.environ.items() if k.startswith(SECRET_ENV_PREFIX) and v.strip()] -def scrub_secrets(msg: str, secrets: List[str]) -> str: +def scrub_secrets(msg: Any, secrets: List[str]) -> Any: scrubbed = str(msg) for secret in secrets: scrubbed = scrubbed.replace(secret, "*****") - return scrubbed + return msg if str(msg) == scrubbed else scrubbed class DbtBaseException(Exception):