From ac764d0f105b8981a42bb655fec4a928658663af Mon Sep 17 00:00:00 2001 From: GPK Date: Fri, 22 Nov 2024 09:58:23 +0000 Subject: [PATCH] fix google datacatalog operator tests (#44281) * fix google datacatalog operator tests * bump google-cloud-datacatalog (cherry picked from commit f6bbc633cb4fd05ae26137e5f5ca99b5f6d64abb) --- generated/provider_dependencies.json | 2 +- .../src/airflow/providers/google/provider.yaml | 2 +- .../google/cloud/operators/test_datacatalog.py | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json index c5e413e1e7679..e3ecbed29d979 100644 --- a/generated/provider_dependencies.json +++ b/generated/provider_dependencies.json @@ -655,7 +655,7 @@ "google-cloud-build>=3.22.0", "google-cloud-compute>=1.10.0", "google-cloud-container>=2.17.4", - "google-cloud-datacatalog>=3.11.1", + "google-cloud-datacatalog>=3.23.0", "google-cloud-dataflow-client>=0.8.6", "google-cloud-dataform>=0.5.0", "google-cloud-dataplex>=1.10.0", diff --git a/providers/src/airflow/providers/google/provider.yaml b/providers/src/airflow/providers/google/provider.yaml index 604eff4190fc5..44ab9a52154cf 100644 --- a/providers/src/airflow/providers/google/provider.yaml +++ b/providers/src/airflow/providers/google/provider.yaml @@ -125,7 +125,7 @@ dependencies: - google-cloud-build>=3.22.0 - google-cloud-compute>=1.10.0 - google-cloud-container>=2.17.4 - - google-cloud-datacatalog>=3.11.1 + - google-cloud-datacatalog>=3.23.0 - google-cloud-dataflow-client>=0.8.6 - google-cloud-dataform>=0.5.0 - google-cloud-dataplex>=1.10.0 diff --git a/providers/tests/google/cloud/operators/test_datacatalog.py b/providers/tests/google/cloud/operators/test_datacatalog.py index 577852baf6b61..1d0d0c4992898 100644 --- a/providers/tests/google/cloud/operators/test_datacatalog.py +++ b/providers/tests/google/cloud/operators/test_datacatalog.py @@ -102,9 +102,20 @@ "name": TEST_ENTRY_PATH, } TEST_ENTRY_GROUP: EntryGroup = EntryGroup(name=TEST_ENTRY_GROUP_PATH) -TEST_ENTRY_GROUP_DICT: dict = {"description": "", "display_name": "", "name": TEST_ENTRY_GROUP_PATH} +TEST_ENTRY_GROUP_DICT: dict = { + "description": "", + "display_name": "", + "name": TEST_ENTRY_GROUP_PATH, + "transferred_to_dataplex": False, +} TEST_TAG: Tag = Tag(name=TEST_TAG_PATH) -TEST_TAG_DICT: dict = {"fields": {}, "name": TEST_TAG_PATH, "template": "", "template_display_name": ""} +TEST_TAG_DICT: dict = { + "fields": {}, + "name": TEST_TAG_PATH, + "template": "", + "template_display_name": "", + "dataplex_transfer_status": 0, +} TEST_TAG_TEMPLATE: TagTemplate = TagTemplate(name=TEST_TAG_TEMPLATE_PATH) TEST_TAG_TEMPLATE_DICT: dict = { "display_name": "", @@ -172,6 +183,7 @@ def test_assert_valid_hook_call(self, mock_xcom, mock_hook) -> None: "project_id": TEST_PROJECT_ID, }, ) + assert TEST_ENTRY_DICT == result @mock.patch("airflow.providers.google.cloud.operators.datacatalog.CloudDataCatalogHook")