From 4c1a82403975cac48ce45b0e8f4526b27ffee96d Mon Sep 17 00:00:00 2001 From: William Shin Date: Wed, 11 Dec 2024 12:41:43 -0800 Subject: [PATCH] Remove extra `data_asset_to_expectation_suite_name` mapping from Event (#587) Co-authored-by: Great Expectations Co-authored-by: Rob Lim --- great_expectations_cloud/agent/models.py | 2 -- pyproject.toml | 2 +- ...erate_schema_change_expectations_action.py | 29 ++----------------- ...est_generate_schema_change_expectations.py | 3 -- 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/great_expectations_cloud/agent/models.py b/great_expectations_cloud/agent/models.py index a9fc3292..b86d701e 100644 --- a/great_expectations_cloud/agent/models.py +++ b/great_expectations_cloud/agent/models.py @@ -109,8 +109,6 @@ class GenerateSchemaChangeExpectationsEvent(EventBase): ) datasource_name: str data_assets: Sequence[str] - # TODO: Remove data_asset_to_expectation_suite_name from the event - data_asset_to_expectation_suite_name: Dict[str, str] create_expectations: bool = False diff --git a/pyproject.toml b/pyproject.toml index f512a910..a36c654b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "great_expectations_cloud" -version = "20241210.0.dev0" +version = "20241210.0.dev1" description = "Great Expectations Cloud" authors = ["The Great Expectations Team "] repository = "https://github.com/great-expectations/cloud" diff --git a/tests/agent/actions/test_generate_schema_change_expectations_action.py b/tests/agent/actions/test_generate_schema_change_expectations_action.py index c54c8243..ececa410 100644 --- a/tests/agent/actions/test_generate_schema_change_expectations_action.py +++ b/tests/agent/actions/test_generate_schema_change_expectations_action.py @@ -126,15 +126,11 @@ def mock_schema_change_expectation(self, metric_run: MetricRun, asset_id: uuid.U @pytest.mark.parametrize( - "data_asset_names, data_assets_to_expectation_suite_names, expected_created_resources", + "data_asset_names, expected_created_resources", [ - (["test-data-asset1"], {"test-data-asset1": "test-data-asset1 Suite"}, 2), + (["test-data-asset1"], 2), ( ["test-data-asset1", "test-data-asset2"], - { - "test-data-asset1": "test-data-asset1 Suite", - "test-data-asset2": "test-data-asset2 Suite", - }, 4, ), ], @@ -144,7 +140,6 @@ def test_generate_schema_change_expectations_action_success( mock_context: CloudDataContext, mocker: MockerFixture, data_asset_names, - data_assets_to_expectation_suite_names, # TODO: Remove data_asset_to_expectation_suite_name from the event expected_created_resources, ): # setup @@ -174,8 +169,6 @@ def test_generate_schema_change_expectations_action_success( organization_id=uuid.uuid4(), datasource_name="test-datasource", data_assets=data_asset_names, - # TODO: Remove data_asset_to_expectation_suite_name from the event - data_asset_to_expectation_suite_name=data_assets_to_expectation_suite_names, create_expectations=True, ), id="test-id", @@ -194,31 +187,22 @@ def test_generate_schema_change_expectations_action_success( @pytest.mark.parametrize( - "succeeding_data_asset_names, suceeding_data_assets_to_expectation_suite_names, failing_data_asset_names, error_message_header", + "succeeding_data_asset_names, failing_data_asset_names, error_message_header", [ pytest.param( ["test-data-asset1"], - {"test-data-asset1": "test-data-asset1 Suite"}, ["retrieve-fail-asset-1"], "Unable to fetch schemas for 1 of 2 Data Assets.", id="Single asset passing, single asset failing", ), pytest.param( ["test-data-asset1", "test-data-asset2"], - { - "test-data-asset1": "test-data-asset1 Suite", - "test-data-asset2": "test-data-asset2 Suite", - }, ["retrieve-fail-asset-1"], "Unable to fetch schemas for 1 of 3 Data Assets.", id="Multiple assets passing, single asset failing", ), pytest.param( ["test-data-asset1", "test-data-asset2"], - { - "test-data-asset1": "test-data-asset1 Suite", - "test-data-asset2": "test-data-asset2 Suite", - }, [ "retrieve-fail-asset-1", "retrieve-fail-asset-2", @@ -230,10 +214,6 @@ def test_generate_schema_change_expectations_action_success( ), pytest.param( ["test-data-asset1", "test-data-asset2"], - { - "test-data-asset1": "test-data-asset1 Suite", - "test-data-asset2": "test-data-asset2 Suite", - }, [ "retrieve-fail-asset-1", "retrieve-fail-asset-2", @@ -256,7 +236,6 @@ def test_succeeding_and_failing_assets_together( mocker: MockerFixture, succeeding_data_asset_names: list[str], failing_data_asset_names: list[str], - suceeding_data_assets_to_expectation_suite_names, error_message_header: str, ): # setup @@ -280,8 +259,6 @@ def test_succeeding_and_failing_assets_together( organization_id=uuid.uuid4(), datasource_name="test-datasource", data_assets=succeeding_data_asset_names + failing_data_asset_names, - # TODO: Remove data_asset_to_expectation_suite_name from the event - data_asset_to_expectation_suite_name=suceeding_data_assets_to_expectation_suite_names, create_expectations=True, ), id="test-id", diff --git a/tests/integration/actions/test_generate_schema_change_expectations.py b/tests/integration/actions/test_generate_schema_change_expectations.py index 991a433c..428512af 100644 --- a/tests/integration/actions/test_generate_schema_change_expectations.py +++ b/tests/integration/actions/test_generate_schema_change_expectations.py @@ -111,9 +111,6 @@ def test_running_schema_change_expectation_action( type="generate_schema_change_expectations_request.received", datasource_name="local_mercury_db", data_assets=["local-mercury-db-checkpoints-table"], - data_asset_to_expectation_suite_name={ - "local-mercury-db-checkpoints-table": "local-mercury-db-checkpoints-table Suite" - }, organization_id=uuid.UUID(org_id_env_var_local), )