-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature: conditional transform #34
Comments
I wonder, does that condition apply to the whole record or a specific transformer? So here is the definition of the transformation now:
In my point of view, there might be a condition for the whole record and for specific transformer. The prototype might be:
If we are talking about tuple filtering then it is connected with other features (database scale down). As for now, it is better to use the |
This applies to the whole record. It is very useful to also selectively not anonymize certain column values. We have been able to achieve that with an if statement in template logic. However it would be useful to have a declarative way of doing it as you show. |
Just want to inform you that this feature is going to be published right after the next major |
Requires more testing – moved to Q4 |
I don't want to transform some user data, in particular some of our email developers, as I understand it, this functionality is not fully implemented?
|
@SiPaff if you preserve the UUID during transformations then after running greenmask you could restore developer emails based on a list of (UUID, email) or possibly group/permission membership if those have not changed. |
@wwoytenko This approach doesn't quite meet the requirements. We'll have to use pg_datanymizer the old-fashioned way, but we're looking forward to this opportunity in greemaskIO. |
I made significant revisions to #34. I still need to add some tests for the transformation pipeline, and then this will be released in v0.2.1 on October 31. Some things to discuss:The conditions will work only with the current table scope, meaning you can't evaluate conditions based on values in another table. For example, this does not work:
Instead, you will be able to use:
It uses expressions similar to templates. P.S. |
The feature is now available in main. The release is planned on 31.10.2024 https://docs.greenmask.io/dev/built_in_transformers/transformation_condition/ |
@wwoytenko awesome! Supporting arbitrary SQL or a join to another table is definitely useful. But I could probably use this as is by having a pre-query step and templating. BTW, the docs link give me a cert error on a chromium browser. |
I hope now cert issue is fixed. |
Works for me now. |
I created #227 feat request - sql cond implementation |
A conditional transform states a SQL condition used to decide whether or not to transform a row. In datanymizer a where clause is given as a string. This API seems to work. Below
groups
is a table.Datanymizer implemented this by adding
NOT
to the given query. I fixed an issue that addingNOT
also needs proper NULL-checking behavior: datanymizer/datanymizer@24e2521The text was updated successfully, but these errors were encountered: