From aee3288efd5b9ab413b1319add50c4db25b05bce Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Tue, 14 Nov 2023 08:46:22 -0600 Subject: [PATCH] update tests --- .../multi_table/_properties/test_boundary.py | 4 ++-- .../_properties/test_cardinality.py | 2 +- .../_properties/test_column_pair_trends.py | 4 ++-- .../_properties/test_column_shapes.py | 4 ++-- .../multi_table/_properties/test_coverage.py | 4 ++-- .../_properties/test_data_validity.py | 4 ++-- .../_properties/test_inter_table_trends.py | 4 ++-- .../multi_table/test_quality_report.py | 22 +++++++++---------- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/integration/reports/multi_table/_properties/test_boundary.py b/tests/integration/reports/multi_table/_properties/test_boundary.py index ec951aff..5f5a9e8d 100644 --- a/tests/integration/reports/multi_table/_properties/test_boundary.py +++ b/tests/integration/reports/multi_table/_properties/test_boundary.py @@ -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.""" @@ -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 diff --git a/tests/integration/reports/multi_table/_properties/test_cardinality.py b/tests/integration/reports/multi_table/_properties/test_cardinality.py index dbcd3381..596a1057 100644 --- a/tests/integration/reports/multi_table/_properties/test_cardinality.py +++ b/tests/integration/reports/multi_table/_properties/test_cardinality.py @@ -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) diff --git a/tests/integration/reports/multi_table/_properties/test_column_pair_trends.py b/tests/integration/reports/multi_table/_properties/test_column_pair_trends.py index 0966d36d..42ce5b11 100644 --- a/tests/integration/reports/multi_table/_properties/test_column_pair_trends.py +++ b/tests/integration/reports/multi_table/_properties/test_column_pair_trends.py @@ -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.""" @@ -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 diff --git a/tests/integration/reports/multi_table/_properties/test_column_shapes.py b/tests/integration/reports/multi_table/_properties/test_column_shapes.py index 18290ed4..4e25e7ff 100644 --- a/tests/integration/reports/multi_table/_properties/test_column_shapes.py +++ b/tests/integration/reports/multi_table/_properties/test_column_shapes.py @@ -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.""" @@ -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 diff --git a/tests/integration/reports/multi_table/_properties/test_coverage.py b/tests/integration/reports/multi_table/_properties/test_coverage.py index a5bc36f5..deecf06e 100644 --- a/tests/integration/reports/multi_table/_properties/test_coverage.py +++ b/tests/integration/reports/multi_table/_properties/test_coverage.py @@ -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.""" @@ -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 diff --git a/tests/integration/reports/multi_table/_properties/test_data_validity.py b/tests/integration/reports/multi_table/_properties/test_data_validity.py index 3f5ec7cc..cca01775 100644 --- a/tests/integration/reports/multi_table/_properties/test_data_validity.py +++ b/tests/integration/reports/multi_table/_properties/test_data_validity.py @@ -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.""" @@ -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 diff --git a/tests/integration/reports/multi_table/_properties/test_inter_table_trends.py b/tests/integration/reports/multi_table/_properties/test_inter_table_trends.py index 4b0e86de..e021f7d2 100644 --- a/tests/integration/reports/multi_table/_properties/test_inter_table_trends.py +++ b/tests/integration/reports/multi_table/_properties/test_inter_table_trends.py @@ -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.""" @@ -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 diff --git a/tests/integration/reports/multi_table/test_quality_report.py b/tests/integration/reports/multi_table/test_quality_report.py index dcfa41af..c4c69722 100644 --- a/tests/integration/reports/multi_table/test_quality_report.py +++ b/tests/integration/reports/multi_table/test_quality_report.py @@ -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', @@ -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(): @@ -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) @@ -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': [ @@ -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'", @@ -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) @@ -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