From c336d86a44565e0517287daa7974de03fee9dc4b Mon Sep 17 00:00:00 2001 From: Teddy Date: Thu, 25 Jul 2024 08:24:15 +0200 Subject: [PATCH] chore: add "learning" sample data for dynamic assertion (#17155) --- .../sample_data/tests/testCaseResults.json | 31 +++++-------------- .../sample_data/tests/testSuites.json | 12 ++----- .../ingestion/source/database/sample_data.py | 1 + 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/ingestion/examples/sample_data/tests/testCaseResults.json b/ingestion/examples/sample_data/tests/testCaseResults.json index d5bd6d76257..d18a0cf0859 100644 --- a/ingestion/examples/sample_data/tests/testCaseResults.json +++ b/ingestion/examples/sample_data/tests/testCaseResults.json @@ -478,9 +478,7 @@ "name": "max", "value": "None" } - ], - "maxBound": 96162, - "minBound": 90001 + ] }, { "result": "Found min=35005, max=92808 vs. the expected min=90001, max=96162.", @@ -494,9 +492,7 @@ "name": "max", "value": "92808" } - ], - "maxBound": 96162, - "minBound": 90001 + ] }, { "result": "Found min=90006, max=92808 vs. the expected min=90001, max=96162.", @@ -538,9 +534,7 @@ "name": "max", "value": "99001" } - ], - "maxBound": 96162, - "minBound": 90001 + ] }, { "result": "Found min=1001, max=2789 vs. the expected min=90001, max=96162.", @@ -554,9 +548,7 @@ "name": "max", "value": "2789" } - ], - "maxBound": 96162, - "minBound": 90001 + ] }, { "result": "Found min=91009, max=92808 vs. the expected min=90001, max=96162.", @@ -570,8 +562,7 @@ "name": "max", "value": "92808" } - ], - "minBound": 90001 + ] }, { "result": "Found min=90008, max=92808 vs. the expected min=90001, max=96162.", @@ -585,9 +576,7 @@ "name": "max", "value": "92808" } - ], - "maxBound": 96162, - "minBound": 90001 + ] }, { "result": "Found min=92000, max=92808 vs. the expected min=90001, max=96162.", @@ -601,9 +590,7 @@ "name": "max", "value": "92808" } - ], - "maxBound": 96162, - "minBound": 90001 + ] }, { "result": "Found min=90001, max=96612 vs. the expected min=90001, max=96162.", @@ -617,9 +604,7 @@ "name": "max", "value": "96612" } - ], - "maxBound": 96162, - "minBound": 90001 + ] } ] }, diff --git a/ingestion/examples/sample_data/tests/testSuites.json b/ingestion/examples/sample_data/tests/testSuites.json index 4dba198146c..dd66cc33d9e 100644 --- a/ingestion/examples/sample_data/tests/testSuites.json +++ b/ingestion/examples/sample_data/tests/testSuites.json @@ -236,16 +236,8 @@ "description": "test the number of column in table is between x and y", "entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address::columns::zip>", "testDefinitionName": "columnValuesToBeBetween", - "parameterValues": [ - { - "name": "min", - "value": "90001" - }, - { - "name": "max", - "value": "96162" - } - ], + "parameterValues": [], + "useDynamicAssertion": true, "resolutions": { "sequenceOne": [ { diff --git a/ingestion/src/metadata/ingestion/source/database/sample_data.py b/ingestion/src/metadata/ingestion/source/database/sample_data.py index 24b84bbf06f..b7bd963d9b0 100644 --- a/ingestion/src/metadata/ingestion/source/database/sample_data.py +++ b/ingestion/src/metadata/ingestion/source/database/sample_data.py @@ -1500,6 +1500,7 @@ class SampleDataSource( TestCaseParameterValue(**param_values) for param_values in test_case["parameterValues"] ], + useDynamicAssertion=test_case.get("useDynamicAssertion", False), ) # type: ignore ) yield Either(right=test_case_req)