Skip to content

Commit

Permalink
Scrub strings, not AttributeErrors (#3972)
Browse files Browse the repository at this point in the history
* Cast log msg to str before .replace()

* Skip assignment
  • Loading branch information
jtcohen6 authored Sep 29, 2021
1 parent 571beb1 commit fe9ed9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Contributors:
### Fixes
- Fix batching for large seeds on Snowflake ([#3941](https://github.com/dbt-labs/dbt/issues/3941), [#3942](https://github.com/dbt-labs/dbt/pull/3942))
- Avoid infinite recursion in `state:modified.macros` check ([#3904](https://github.com/dbt-labs/dbt/issues/3904), [#3957](https://github.com/dbt-labs/dbt/pull/3957))
- Cast log messages to strings before scrubbing of prefixed env vars ([#3971](https://github.com/dbt-labs/dbt/issues/3971), [#3972](https://github.com/dbt-labs/dbt/pull/3972))

### Under the hood
- Bump artifact schema versions for 0.21.0 ([#3945](https://github.com/dbt-labs/dbt/pull/3945))
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def process(self, record):
class ScrubSecrets(logbook.Processor):
def process(self, record):
for secret in get_secret_env():
record.message = record.message.replace(secret, "*****")
record.message = str(record.message).replace(secret, "*****")


logger = logbook.Logger('dbt')
Expand Down

0 comments on commit fe9ed9c

Please sign in to comment.