-
Notifications
You must be signed in to change notification settings - Fork 190
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
Redact values from logs due 'duplicate key' error #773
Redact values from logs due 'duplicate key' error #773
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaypeedevlin thanks for raising this PR 🤩 !
Three things to get this passing CI:
- Code suggestion to expect
dbt run
to fail when it raises the error - Code suggestion to apply the expected code format
- Add a changelog entry via
changie new
Just let @dataders or myself if you want an assist with any of the above.
tests/functional/duplicate_key_unlogged/test_duplicate_key_not_in_exceptions.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Doug Beatty <[email protected]>
@dbeatty10 thanks for the review — I believe this should now be good to go. Assuming the merge goes through if there's any possibility to get this backported to 1.6.x that would be a massive help for us! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @jaypeedevlin! I just had two suggestions, otherwise I like the approach.
tests/functional/redact_log_values/test_duplicate_key_not_in_exceptions.py
Show resolved
Hide resolved
* Add failing test * Fix model test naming * Add redaction looping logic * Apply suggestions from code review Co-authored-by: Doug Beatty <[email protected]> * Add changelog * Fix test case * Rename test class * Colocate redaction tests * Ignore if dbt run passes or fails * Materialize as a table instead of a view to trigger an error * Expect the run to fail with a specific error message * Reverse order of dict, assert that sensitive data is replaced * Add newline --------- Co-authored-by: Doug Beatty <[email protected]> Co-authored-by: Mike Alfare <[email protected]> (cherry picked from commit 9fa8de2)
* Add failing test * Fix model test naming * Add redaction looping logic * Apply suggestions from code review Co-authored-by: Doug Beatty <[email protected]> * Add changelog * Fix test case * Rename test class * Colocate redaction tests * Ignore if dbt run passes or fails * Materialize as a table instead of a view to trigger an error * Expect the run to fail with a specific error message * Reverse order of dict, assert that sensitive data is replaced * Add newline --------- Co-authored-by: Doug Beatty <[email protected]> Co-authored-by: Mike Alfare <[email protected]> (cherry picked from commit 9fa8de2)
* Add failing test * Fix model test naming * Add redaction looping logic * Apply suggestions from code review Co-authored-by: Doug Beatty <[email protected]> * Add changelog * Fix test case * Rename test class * Colocate redaction tests * Ignore if dbt run passes or fails * Materialize as a table instead of a view to trigger an error * Expect the run to fail with a specific error message * Reverse order of dict, assert that sensitive data is replaced * Add newline --------- Co-authored-by: Doug Beatty <[email protected]> Co-authored-by: Mike Alfare <[email protected]> (cherry picked from commit 9fa8de2) Co-authored-by: Josh Devlin <[email protected]>
* Add failing test * Fix model test naming * Add redaction looping logic * Apply suggestions from code review Co-authored-by: Doug Beatty <[email protected]> * Add changelog * Fix test case * Rename test class * Colocate redaction tests * Ignore if dbt run passes or fails * Materialize as a table instead of a view to trigger an error * Expect the run to fail with a specific error message * Reverse order of dict, assert that sensitive data is replaced * Add newline --------- Co-authored-by: Doug Beatty <[email protected]> Co-authored-by: Mike Alfare <[email protected]> (cherry picked from commit 9fa8de2) Co-authored-by: Josh Devlin <[email protected]>
* Add failing test * Fix model test naming * Add redaction looping logic * Apply suggestions from code review Co-authored-by: Doug Beatty <[email protected]> * Add changelog * Fix test case * Rename test class * Colocate redaction tests * Ignore if dbt run passes or fails * Materialize as a table instead of a view to trigger an error * Expect the run to fail with a specific error message * Reverse order of dict, assert that sensitive data is replaced * Add newline --------- Co-authored-by: Doug Beatty <[email protected]> Co-authored-by: Mike Alfare <[email protected]>
resolves #772
Docs N/A
Assuming this is merged, it would be amazing if this could be backported into 1.6.x so we can take advantage in our org without having to go through a minor version upgrade (which there's a lot of work involved given our scale)
Problem
We are leaking raw data into logs in certain cases.
Solution
Copies the method that exists, placing code into a loop to handle any other future cases that may arise.
Checklist