Skip to content

Commit

Permalink
Do not cast unscrubbed values to a string (#165)
Browse files Browse the repository at this point in the history
* Do not cast unscrubbed values to a string

* Changelog entry
  • Loading branch information
dbeatty10 authored Sep 20, 2024
1 parent e1d77b6 commit 98ccfce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240709-190235.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions dbt_common/exceptions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 98ccfce

Please sign in to comment.