From 3fcf7115055c048fc0506e852f51cf22043aa2e8 Mon Sep 17 00:00:00 2001 From: Felipe Date: Tue, 31 Oct 2023 09:22:45 -0700 Subject: [PATCH] Add integration test --- .../single_table/test_single_table.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/single_table/test_single_table.py b/tests/integration/single_table/test_single_table.py index 16429a96..fd8e0766 100644 --- a/tests/integration/single_table/test_single_table.py +++ b/tests/integration/single_table/test_single_table.py @@ -147,3 +147,26 @@ def test_newrowsynthesis_with_special_characters_in_column_names(): # Assert assert metric == 0.66666666666666667 + + +def test_new_row_synthesis_datetime_as_string(): + """Test it works when the datetime column is a string.""" + # Setup + data = pd.DataFrame(data={ + 'id': [0, 1, 2, 3, 4], + 'datetime_column': ['2010-02-23', '2010-01-01', '2010-03-30', '2010-03-23', '2010-03-04'], + 'numerical_column': [1, 2, 3, 4, 5], + 'categorical_column': [1, 2, 2, 1, 2] + }) + + # Run + metric = NewRowSynthesis.compute( + real_data=data, + synthetic_data=data, + numerical_match_tolerance=0.01, + synthetic_sample_size=10_000 + + ) + + # Assert + assert metric == 0.0