You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reverse_transform_subset method is meant to only reverse transform the columns that are inputted. However, it appears to be creating additional columns from AnonymizedFaker and RegexGenerator transformers.
This is likely happening because these two transformers drop columns on the forward transform.
Steps to reproduce
fromrdtimportget_demofromrdtimportHyperTransformerfromrdt.transformers.piiimportAnonymizedFakerfromrdt.transformers.textimportRegexGenerator# create some datacustomers=get_demo()
customers['id'] = ['ID_a', 'ID_b', 'ID_c', 'ID_d', 'ID_e']
# create a confight=HyperTransformer()
ht.detect_initial_config(customers)
# credit_card and id are pii and text columnsht.update_sdtypes({
'credit_card': 'pii',
'id': 'text'
})
ht.update_transformers({
'credit_card': AnonymizedFaker(),
'id': RegexGenerator(regex_format='id_[a-z]')
})
# transform the data# this will drop the credit card and id columnsht.fit(customers)
transformed=ht.transform(customers)
# try to reverse transform only the login columnht.reverse_transform_subset(transformed[['last_login.value']])
Output
The credit_card and id columns are recreated during reverse_transform_subset even though I only asked to reverse transform the last_login column.
I expect that only the last_login column will be created.
The text was updated successfully, but these errors were encountered:
Environment Details
Error Description
The
reverse_transform_subset
method is meant to only reverse transform the columns that are inputted. However, it appears to be creating additional columns fromAnonymizedFaker
andRegexGenerator
transformers.This is likely happening because these two transformers drop columns on the forward transform.
Steps to reproduce
Output
The
credit_card
andid
columns are recreated duringreverse_transform_subset
even though I only asked to reverse transform thelast_login
column.I expect that only the
last_login
column will be created.The text was updated successfully, but these errors were encountered: