Skip to content

Commit 3e0bfe9

Browse files
committed
Remove pii check from id and bad test
1 parent fb034c7 commit 3e0bfe9

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

sdv/data_processing/data_processor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def _create_config(self, data, columns_created_by_constraints):
572572
column, sdtype, column_metadata, is_numeric
573573
)
574574
sdtypes[column] = 'text'
575-
elif column in self._keys or column_metadata.get('pii'):
575+
elif column in self._keys:
576576
if is_numeric:
577577
function_name = 'random_int'
578578
column_dtype = str(column_dtype).lower()

tests/integration/sequential/test_par.py

-32
Original file line numberDiff line numberDiff line change
@@ -466,35 +466,3 @@ def test_par_categorical_column_represented_by_floats():
466466
# Assert
467467
synth.validate(sampled)
468468
assert sampled['category'].isin(data['category']).all()
469-
470-
471-
def test_par_multiple_sequence_keys():
472-
"""Test the ``PARSynthesizer`` end to end."""
473-
# Setup
474-
data = load_demo()
475-
data['date'] = pd.to_datetime(data['date'])
476-
metadata = Metadata.detect_from_dataframes({'table': data})
477-
metadata.update_column('store_id', 'table', sdtype='id')
478-
metadata.set_sequence_key('store_id', 'table')
479-
480-
metadata.set_sequence_index('date', 'table')
481-
482-
model = PARSynthesizer(
483-
metadata=metadata,
484-
context_columns=['region'],
485-
epochs=1,
486-
)
487-
488-
# Run
489-
model.fit(data)
490-
sampled = model.sample(100)
491-
492-
# Assert
493-
assert sampled.shape == data.shape
494-
assert (sampled.dtypes == data.dtypes).all()
495-
assert (sampled.notna().sum(axis=1) != 0).all()
496-
loss_values = model.get_loss_values()
497-
assert len(loss_values) == 1
498-
assert all(sampled.groupby('store_id')['date'].is_monotonic_increasing)
499-
assert all(sampled.groupby('store_id')['date'].agg(lambda x: x.is_unique))
500-
assert all(sampled['total_sales'].round(2) == sampled['total_sales'])

0 commit comments

Comments
 (0)