-
Notifications
You must be signed in to change notification settings - Fork 73
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
Allow masking without primary keys #5575
Allow masking without primary keys #5575
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
fides Run #11684
Run Properties:
|
Project |
fides
|
Branch Review |
refs/pull/5575/merge
|
Run status |
Passed #11684
|
Run duration | 00m 50s |
Commit |
5012041c66 ℹ️: Merge dec9b211e093ffa8a41ebba7728cc977cd0cba41 into a009dbb68834e540a42aac8889e1...
|
Committer | Adrian Galvan |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
4
|
View all changes introduced in this branch ↗︎ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## split-query-config-files #5575 +/- ##
=============================================================
+ Coverage 71.31% 87.14% +15.82%
=============================================================
Files 388 388
Lines 23988 24000 +12
Branches 2594 2593 -1
=============================================================
+ Hits 17107 20914 +3807
+ Misses 6326 2525 -3801
- Partials 555 561 +6 ☔ View full report in Codecov by Sentry. |
if ( | ||
self.connector.requires_primary_keys | ||
and not self.execution_node.collection.contains_field( | ||
lambda f: f.primary_key | ||
) | ||
): |
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.
Key change - This is where I added the additional check for requires_primary_keys
@property | ||
def reference_field_paths(self) -> Dict[FieldPath, Field]: | ||
"""Mapping of FieldPaths to Fields that have incoming identity or dataset references""" | ||
return { | ||
field_path: field | ||
for field_path, field in self.field_map().items() | ||
if field_path in {edge.f2.field_path for edge in self.node.incoming_edges} | ||
} |
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.
Very important change - this is what allows us to use the dataset references instead of the primary key fields for the where clauses
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.
Manually tested and this is working great!
Just 1 q to address, below
Closes LA-95
Description Of Changes
Removed the need to include primary keys for erasure requests for BigQuery and Postgres. Before this change, all connectors required collections to have one field that contained
primary_key: True
for that collection to be masked. In order to make this an incremental change, I added arequires_primary_keys
property toBaseConnector
which I defaulted toTrue
. Every connector can either override this, or keep the default behavior.Code Changes
requires_primary_keys
to Falserequires_primary_keys
to Falserequires_primary_keys
to True and included a comment about ScyllaDB requiring the where clause for an update to be a primary keySteps to Confirm
primary_key
annotations fromsrc/fides/data/sample_project/sample_resources/postgres_example_test_dataset.yml
nox -s "fides_env(test)"
[email protected]
. Verify both are still possible without primary keys.Pre-Merge Checklist
CHANGELOG.md
updatedmain
downgrade()
migration is correct and works