@@ -207,7 +207,7 @@ def _apply_action(
207
207
custom_mask : str | None = None ,
208
208
regex_pattern : str | None = None ,
209
209
mask_format : str | None = None ,
210
- ** kwargs : Any ,
210
+ ** encryption_context : Any ,
211
211
) -> Any :
212
212
"""
213
213
Helper method to determine whether to apply a given action to the entire input data
@@ -242,19 +242,24 @@ def _apply_action(
242
242
custom_mask = custom_mask ,
243
243
regex_pattern = regex_pattern ,
244
244
mask_format = mask_format ,
245
- ** kwargs ,
246
245
)
247
246
else :
248
247
logger .debug (f"Running action { action .__name__ } with the entire data" )
249
- return action (
250
- data = data ,
251
- provider_options = provider_options ,
252
- dynamic_mask = dynamic_mask ,
253
- custom_mask = custom_mask ,
254
- regex_pattern = regex_pattern ,
255
- mask_format = mask_format ,
256
- ** kwargs ,
257
- )
248
+ if action .__name__ == "erase" :
249
+ return action (
250
+ data = data ,
251
+ provider_options = provider_options ,
252
+ dynamic_mask = dynamic_mask ,
253
+ custom_mask = custom_mask ,
254
+ regex_pattern = regex_pattern ,
255
+ mask_format = mask_format ,
256
+ )
257
+ else :
258
+ return action (
259
+ data = data ,
260
+ provider_options = provider_options ,
261
+ ** encryption_context ,
262
+ )
258
263
259
264
def _apply_action_to_fields (
260
265
self ,
0 commit comments