Skip to content

Conversation

AdamJKoehler
Copy link
Contributor

@AdamJKoehler AdamJKoehler commented May 8, 2025

Bug #9180

Type of Change

  • Bug fix (non-breaking change, fixes Invoke-DbaDbDataMasking.ps1 failing on bit columns #9180 )
  • New feature (non-breaking change, adds functionality, fixes # )
  • Breaking change (affects multiple commands or functionality, fixes # )
  • Ran manual Pester test and has passed (Invoke-ManualPester)
  • Adding code coverage to existing functionality
  • Pester test is included
  • If new file reference added for test, has is been added to github.com/dataplat/appveyor-lab ?
  • Unit test is included
  • Documentation
  • Build system

Purpose
Fix up Invoke-DbaDbDatamasking to improve bit & decimal value support

Approach
There was a missing check if a data type was a decimal and the value came back blank instead of with an actual value. I changed this to make sure that if blank is returned, it is set to 0.00 instead. I also encountered errors with bit values as in the open item, and was able to track down the error to Convert-DbaMaskingValue using Claude Code & my error message. It made the recommendations to improve the RegEx search string and to add the additional checks for boolean values to convert to 1 & 0 for a bit column in the database. I also updated the tests to test for decimal and bit values & masking them as well.

@AdamJKoehler AdamJKoehler marked this pull request as draft May 8, 2025 21:51
@AdamJKoehler AdamJKoehler marked this pull request as ready for review May 9, 2025 22:14
Copy link
Contributor

@andreasjordan andreasjordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the time to test this, but I left some comments. Will try to test this in the next days.

Copy link
Contributor

@andreasjordan andreasjordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, just tested this in my lab. Looks good to me.

@andreasjordan
Copy link
Contributor

I would suggest to merge this now and then after that have a look at #9671

@jpomfret jpomfret merged commit 4e8aebf into dataplat:development Jun 11, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invoke-DbaDbDataMasking.ps1 failing on bit columns
3 participants