Skip to content

Commit

Permalink
set the min to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Oct 25, 2024
1 parent 5a2be9f commit 7834a5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions sdv/data_processing/data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ def _create_config(self, data, columns_created_by_constraints):
column_dtype = str(column_dtype).lower()
for key in INTEGER_BOUNDS:
if key in column_dtype:
min_value, max_value = INTEGER_BOUNDS[key]
function_kwargs = {'min': min_value, 'max': max_value}
_, max_value = INTEGER_BOUNDS[key]
function_kwargs = {'min': 0, 'max': max_value}

else:
function_kwargs = {'text': 'sdv-id-??????'}
Expand Down
20 changes: 10 additions & 10 deletions tests/integration/single_table/test_copulas.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,16 @@ def test_numerical_columns_gets_pii():
# Assert
expected_sampled = pd.DataFrame({
'id': [
2099712954613693783,
-152666675184636528,
4268567557886801441,
8596895119661928307,
6592419880288711333,
7082988828807721487,
-1204202270621625701,
3831203727630084512,
-4724549333540186445,
496832674032232864,
1089619006166876142,
8373046707753416652,
9070705361670139280,
7227045982112645011,
3461931576753619633,
1005734164466301683,
3312031189447929384,
82456842876428117,
1819741328868365520,
8019169766233150107,
],
'city': [
'Danielfort',
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/data_processing/test_data_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,19 +1245,19 @@ def test__create_config(self):
id_numeric_int_8_transformer = config['transformers']['id_numeric_int8']
assert isinstance(id_numeric_int_8_transformer, AnonymizedFaker)
assert id_numeric_int_8_transformer.function_name == 'random_int'
assert id_numeric_int_8_transformer.function_kwargs == {'min': -128, 'max': 127}
assert id_numeric_int_8_transformer.function_kwargs == {'min': 0, 'max': 127}
assert id_numeric_int_8_transformer.cardinality_rule == 'unique'

id_numeric_int_16_transformer = config['transformers']['id_numeric_int16']
assert isinstance(id_numeric_int_16_transformer, AnonymizedFaker)
assert id_numeric_int_16_transformer.function_name == 'random_int'
assert id_numeric_int_16_transformer.function_kwargs == {'min': -32768, 'max': 32767}
assert id_numeric_int_16_transformer.function_kwargs == {'min': 0, 'max': 32767}

id_numeric_int_32_transformer = config['transformers']['id_numeric_int32']
assert isinstance(id_numeric_int_32_transformer, AnonymizedFaker)
assert id_numeric_int_32_transformer.function_name == 'random_int'
assert id_numeric_int_32_transformer.function_kwargs == {
'min': -2147483648,
'min': 0,
'max': 2147483647,
}

Expand Down

0 comments on commit 7834a5f

Please sign in to comment.