Repository navigation
[FIX] PII detection missed in numeric columns - coerce values to string - #31921
Conversation
Use numbers.Number instead of (int, float) to handle Decimal, Fraction and other numeric types from database drivers (e.g., Oracle NUMBER via oracledb returns decimal.Decimal). Previously these values were silently skipped by convert_to_str(), making PII in numeric columns invisible to content-based classification. Closes open-metadata#31847
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedExpands value coercion in preprocessing to cover all OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
🚦 Removed from the merge queue —
|
35cb82a
…ng (#31921) Use numbers.Number instead of (int, float) to handle Decimal, Fraction and other numeric types from database drivers (e.g., Oracle NUMBER via oracledb returns decimal.Decimal). Previously these values were silently skipped by convert_to_str(), making PII in numeric columns invisible to content-based classification. Closes #31847 Co-authored-by: Teddy <[email protected]>
…ng (open-metadata#31921) Use numbers.Number instead of (int, float) to handle Decimal, Fraction and other numeric types from database drivers (e.g., Oracle NUMBER via oracledb returns decimal.Decimal). Previously these values were silently skipped by convert_to_str(), making PII in numeric columns invisible to content-based classification. Closes open-metadata#31847 Co-authored-by: Teddy <[email protected]>



What changes were proposed in this pull request?
Fix #31847: Numeric column values (e.g., Oracle NUMBER type via
oracledb) are captured in sample data but never evaluated by content-based pattern recognizers becauseconvert_to_str()only handledintandfloat, missingdecimal.Decimaland othernumbers.Numbersubclasses.Changes
preprocessing.py: Replaceisinstance(value, (int, float, ...))withisinstance(value, (numbers.Number, ...))to handle all numeric types includingdecimal.Decimal,fractions.Fraction, etc.test_preprocessing.py: Add test cases fordecimal.DecimalvaluesRoot cause
Oracle
NUMBERtype viaoracledbdriver returnsdecimal.Decimal, which is not a subclass ofintorfloat. The oldisinstancecheck silently skipped these values, making PII in numeric columns (national IDs, employee numbers, phone numbers) invisible to classification.Related issues
Greptile Summary
The PR broadens PII preprocessing to stringify all
numbers.Numbervalues, allowing database-native numeric types such asdecimal.Decimalto reach content-based recognizers.intandfloatcheck withnumbers.Number.decimal.Decimalvalues.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Decimaland other numeric implementations without changing the surrounding preprocessing flow.Decimalvalues.Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/pii-detecti..." | Re-trigger Greptile