Skip to content

Commit

Permalink
Update FixedCombinations uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
fealho committed Dec 16, 2024
1 parent 0b131a4 commit 6028dfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdv/constraints/tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _fit(self, table_data):
self._uuids_to_combinations = {}
for combination in self._combinations.itertuples(index=False, name=None):
mappable_combination = get_mappable_combination(combination)
uuid_str = str(uuid.uuid4())
uuid_str = str(uuid.uuid5(uuid.NAMESPACE_DNS, str(mappable_combination)))
self._combinations_to_uuids[mappable_combination] = uuid_str
self._uuids_to_combinations[uuid_str] = mappable_combination

Expand Down
5 changes: 4 additions & 1 deletion tests/integration/constraints/test_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def test_fixed_combinations_with_nans():
assert len(synthetic_data) == 1000
pd.testing.assert_frame_equal(
synthetic_data.drop_duplicates(ignore_index=True),
data.drop_duplicates(ignore_index=True),
pd.DataFrame({
'A': [1, np.nan, 2],
'B': [10, 30, 20],
}).drop_duplicates(ignore_index=True),
check_like=True,
)

Expand Down

0 comments on commit 6028dfe

Please sign in to comment.