SCRUM-1053-explore profile reports the value domain of a low-cardinality non-PII… - #238
Open
emnarahmouni-exmergo wants to merge 5 commits into
Open
SCRUM-1053-explore profile reports the value domain of a low-cardinality non-PII…#238emnarahmouni-exmergo wants to merge 5 commits into
emnarahmouni-exmergo wants to merge 5 commits into
Conversation
…into SCRUM-1053-ISSUE-203
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes : #203


ColumnProfile gains a value_domain field (ValueDomain: capped values by frequency + elided count), populated by a new _probe_value_domains step in explore/profile.py.
Eligibility (all required): no PII flag at any confidence, distinct count ≤ 25 and ≤ 10% of non-null rows, not a candidate key (single-column or proven composite member).
New adapter capability value_domain_counts, implemented for DuckDB and BigQuery this pass (one batched statement: capped top-K by frequency + exact distinct-group count per column). Other connectors don't implement it yet and degrade to reporting no domain, same as any adapter that predates this feature.
Eligibility is decided from the approximate pre-scan distinct count (cost control); the reported domain is built from the exact count the probe returns if approximation under-estimated but the true count still clears the fraction bar, the result is capped with an honest elided count instead of being dropped; only a true count that breaks the fraction bar is dropped entirely.
BigQuery: cost-gated like every other optional escalation (dry-run, floor at the per-query minimum, try_charge, degrade to {} + a table note on insufficient budget); profile_estimate reserves for it up front.
before the fix :
After fixing :