Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Nov 14, 2023
1 parent c268fc2 commit aee3288
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_end_to_end(self):
result = boundary.get_score(real_data, synthetic_data, metadata)

# Assert
assert result == 0.8666666666666667
assert result == 1.0

def test_with_progress_bar(self):
"""Test that the progress bar is correctly updated."""
Expand All @@ -35,5 +35,5 @@ def test_with_progress_bar(self):
result = boundary.get_score(real_data, synthetic_data, metadata, progress_bar)

# Assert
assert result == 0.8666666666666667
assert result == 1.0
assert mock_update.call_count == num_columns
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_cardinality_property():
figure = cardinality_property.get_visualization('users')

# Assert
assert score == 0.8
assert score == 0.95
assert isinstance(figure, Figure)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_end_to_end(self):
result = column_pair_trends.get_score(real_data, synthetic_data, metadata)

# Assert
assert result == 0.4249665433225429
assert result == 0.45654629583521095

def test_with_progress_bar(self):
"""Test that the progress bar is correctly updated."""
Expand All @@ -38,5 +38,5 @@ def test_with_progress_bar(self):
result = column_pair_trends.get_score(real_data, synthetic_data, metadata, progress_bar)

# Assert
assert result == 0.4249665433225429
assert result == 0.45654629583521095
assert mock_update.call_count == num_iter
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_end_to_end(self):
result = column_shapes.get_score(real_data, synthetic_data, metadata)

# Assert
assert result == 0.7922619047619048
assert result == 0.7978174603174604

def test_with_progress_bar(self):
"""Test that the progress bar is correctly updated."""
Expand All @@ -35,5 +35,5 @@ def test_with_progress_bar(self):
result = column_shapes.get_score(real_data, synthetic_data, metadata, progress_bar)

# Assert
assert result == 0.7922619047619048
assert result == 0.7978174603174604
assert mock_update.call_count == num_columns
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_end_to_end(self):
result = coverage.get_score(real_data, synthetic_data, metadata)

# Assert
assert result == 0.9573447196980541
assert result == 0.8244218804937835

def test_with_progress_bar(self):
"""Test that the progress bar is correctly updated."""
Expand All @@ -35,5 +35,5 @@ def test_with_progress_bar(self):
result = coverage.get_score(real_data, synthetic_data, metadata, progress_bar)

# Assert
assert result == 0.9573447196980541
assert result == 0.8244218804937835
assert mock_update.call_count == num_columns
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_end_to_end(self):
result = column_shapes.get_score(real_data, synthetic_data, metadata)

# Assert
assert result == 0.9636363636363637
assert result == 1.0

def test_with_progress_bar(self):
"""Test that the progress bar is correctly updated."""
Expand All @@ -35,5 +35,5 @@ def test_with_progress_bar(self):
result = column_shapes.get_score(real_data, synthetic_data, metadata, progress_bar)

# Assert
assert result == 0.9636363636363637
assert result == 1.0
assert mock_update.call_count == num_columns
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_end_to_end(self):
result = inter_table_trends.get_score(real_data, synthetic_data, metadata)

# Assert
assert result == 0.48240740740740734
assert result == 0.4416666666666667

def test_with_progress_bar(self):
"""Test that the progress bar is correctly updated."""
Expand All @@ -39,5 +39,5 @@ def test_with_progress_bar(self):
result = inter_table_trends.get_score(real_data, synthetic_data, metadata, progress_bar)

# Assert
assert result == 0.48240740740740734
assert result == 0.4416666666666667
assert mock_update.call_count == num_iter
22 changes: 11 additions & 11 deletions tests/integration/reports/multi_table/test_quality_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def test_quality_report_end_to_end():
# Assert
expected_properties = pd.DataFrame({
'Property': ['Column Shapes', 'Column Pair Trends', 'Cardinality', 'Intertable Trends'],
'Score': [0.6643907563025211, 0.49532155831786817, 0.7, 0.4242296918767507],
'Score': [0.7978174603174604, 0.45654629583521095, 0.95, 0.4416666666666667],
})
assert score == 0.570985501624285
assert score == 0.6615076057048345
pd.testing.assert_frame_equal(properties, expected_properties)
expected_info_keys = {
'report_type', 'generated_date', 'sdmetrics_version', 'num_tables', 'num_rows_real_data',
Expand All @@ -230,7 +230,7 @@ def test_quality_report_end_to_end():
assert info['report_type'] == 'QualityReport'
assert info['num_tables'] == 3
assert info['num_rows_real_data'] == {'sessions': 10, 'users': 10, 'transactions': 10}
assert info['num_rows_synthetic_data'] == {'sessions': 9, 'users': 10, 'transactions': 10}
assert info['num_rows_synthetic_data'] == {'sessions': 10, 'users': 10, 'transactions': 10}


def test_quality_report_with_object_datetimes():
Expand All @@ -253,9 +253,9 @@ def test_quality_report_with_object_datetimes():
# Assert
expected_properties = pd.DataFrame({
'Property': ['Column Shapes', 'Column Pair Trends', 'Cardinality', 'Intertable Trends'],
'Score': [0.7922619047619048, 0.4249665433225429, 0.8, 0.48240740740740734],
'Score': [0.7978174603174604, 0.45654629583521095, 0.95, 0.4416666666666667],
})
assert score == 0.570985501624285
assert score == 0.6615076057048345
pd.testing.assert_frame_equal(properties, expected_properties)


Expand All @@ -278,7 +278,7 @@ def test_quality_report_with_errors():
# Assert
expected_properties = pd.DataFrame({
'Property': ['Column Shapes', 'Column Pair Trends', 'Cardinality', 'Intertable Trends'],
'Score': [0.8276190476190475, 0.5666666666666667, 0.8, 0.6092592592592593]
'Score': [0.8165079365079364, 0.55, 0.95, 0.5833333333333334]
})
expected_details = pd.DataFrame({
'Table': [
Expand All @@ -293,8 +293,8 @@ def test_quality_report_with_errors():
'KSComplement', 'KSComplement', 'TVComplement'
],
'Score': [
0.7, 0.9714285714285714, np.nan, 0.9333333333333333, 0.7333333333333334,
np.nan, np.nan, 0.8
0.8, 0.6825396825396826, np.nan, 0.7999999999999999, 0.9, np.nan,
np.nan, 0.8999999999999999
],
'Error': [
None, None, "TypeError: '<' not supported between instances of 'int' and 'str'",
Expand All @@ -304,7 +304,7 @@ def test_quality_report_with_errors():
None
]
})
assert score == 0.6283893557422969
assert score == 0.7249603174603175
pd.testing.assert_frame_equal(properties, expected_properties)
pd.testing.assert_frame_equal(details_column_shapes, expected_details)

Expand All @@ -323,8 +323,8 @@ def test_quality_report_with_no_relationships():
# Assert
expected_properties = pd.DataFrame({
'Property': ['Column Shapes', 'Column Pair Trends', 'Cardinality', 'Intertable Trends'],
'Score': [0.792262, 0.424967, np.nan, np.nan]
'Score': [0.7978174603174604, 0.45654629583521095, np.nan, np.nan]
})
properties = report.get_properties()
pd.testing.assert_frame_equal(properties, expected_properties)
assert score == 0.6086142240422239
assert score == 0.6271818780763356

0 comments on commit aee3288

Please sign in to comment.