Data maskers
Module with data masking transformers.
DataMaskers
¶
Bases: object
Class containing data masking transformers.
Source code in mkdocs/lakehouse_engine/packages/transformers/data_maskers.py
column_dropper(cols)
classmethod
¶
Drop specific columns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cols |
List[str]
|
list of column names to drop. |
required |
Returns:
Type | Description |
---|---|
Callable
|
A function to be called in .transform() spark function. |
View Example of column_dropper (See full example here)
Source code in mkdocs/lakehouse_engine/packages/transformers/data_maskers.py
hash_masker(cols, approach='SHA', num_bits=256, suffix='_hash')
classmethod
¶
Mask specific columns using an hashing approach.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cols |
List[str]
|
list of column names to mask. |
required |
approach |
str
|
hashing approach. Defaults to 'SHA'. There's "MURMUR3" as well. |
'SHA'
|
num_bits |
int
|
number of bits of the SHA approach. Only applies to SHA approach. |
256
|
suffix |
str
|
suffix to apply to new column name. Defaults to "_hash". Note: you can pass an empty suffix to have the original column replaced. |
'_hash'
|
Returns:
Type | Description |
---|---|
Callable
|
A function to be called in .transform() spark function. |