Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not cast unscrubbed values to a string #165

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading