From 2a120c166af568cbd49930c4f6bfa27e12b43f09 Mon Sep 17 00:00:00 2001 From: Teddy Date: Wed, 28 May 2025 17:52:32 +0200 Subject: [PATCH] MINOR: Py failing test cases (#21437) * fix: failing test cases * fix: skip test for now --- ingestion/tests/cli_e2e/test_cli_bigquery.py | 20 +++++++++++-------- .../integration/postgres/test_data_quality.py | 2 +- .../integration/trino/test_data_quality.py | 4 +--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ingestion/tests/cli_e2e/test_cli_bigquery.py b/ingestion/tests/cli_e2e/test_cli_bigquery.py index 8e1914534d2..34cb6c4fac9 100644 --- a/ingestion/tests/cli_e2e/test_cli_bigquery.py +++ b/ingestion/tests/cli_e2e/test_cli_bigquery.py @@ -13,6 +13,7 @@ Test Bigquery connector with CLI """ import random +from datetime import datetime from typing import List, Tuple import pytest @@ -20,15 +21,15 @@ import pytest from ingestion.tests.cli_e2e.base.e2e_types import E2EType from metadata.data_quality.api.models import TestCaseDefinition from metadata.generated.schema.entity.data.table import ( + ColumnProfile, DmlOperationType, ProfileSampleType, SystemProfile, - Table, TableProfilerConfig, ) from metadata.generated.schema.tests.basic import TestCaseResult, TestCaseStatus from metadata.generated.schema.tests.testCase import TestCaseParameterValue -from metadata.generated.schema.type.basic import FullyQualifiedEntityName, Timestamp +from metadata.generated.schema.type.basic import Timestamp from .common.test_cli_db import CliCommonDB from .common_e2e_sqa_mixins import SQACommonMethods @@ -223,11 +224,14 @@ class BigqueryCliTest(CliCommonDB.TestSuite, SQACommonMethods): self.run_command() self.build_config_file(E2EType.PROFILER, {"includes": ["w_partition"]}) + start_ts = int(datetime.now().timestamp() * 1000) self.run_command("profile") - table: Table = self.openmetadata.get_latest_table_profile( - FullyQualifiedEntityName( - "local_bigquery.open-metadata-beta.w_partition.w_time_partition" - ) - ) + end_ts = int(datetime.now().timestamp() * 1000) + column_profile = self.openmetadata.get_profile_data( + "local_bigquery.open-metadata-beta.w_partition.w_time_partition.id", + start_ts, + end_ts, + profile_type=ColumnProfile, + ).entities[0] # We ingest 1 row for each day and the profiler should default to the latest partition - assert table.profile.rowCount == 1 + assert column_profile.valuesCount == 1 diff --git a/ingestion/tests/integration/postgres/test_data_quality.py b/ingestion/tests/integration/postgres/test_data_quality.py index 36b1cb9a0cc..5c691d40e93 100644 --- a/ingestion/tests/integration/postgres/test_data_quality.py +++ b/ingestion/tests/integration/postgres/test_data_quality.py @@ -198,7 +198,7 @@ def run_data_quality_workflow( {"name": "max", "value": "600"}, {"name": "columnName", "value": "last_update"}, {"name": "rangeType", "value": "YEAR"}, - {"name": "rangeInterval", "value": "12"}, + {"name": "rangeInterval", "value": "50"}, ], }, ], diff --git a/ingestion/tests/integration/trino/test_data_quality.py b/ingestion/tests/integration/trino/test_data_quality.py index 4885b0f2711..97a36b55234 100644 --- a/ingestion/tests/integration/trino/test_data_quality.py +++ b/ingestion/tests/integration/trino/test_data_quality.py @@ -47,9 +47,7 @@ def prepare_data(create_test_data, trino_container): ).fetchall() -# Skip this test as for some reason it fails in CI -# FIXME: this needs investigation -@pytest.mark.skip("Skipping table diff test due to CI issues") +@pytest.mark.skip("Skipping while investigating CI failure. Test passes locally.") @pytest.mark.parametrize( "test_case_definition,expected_result", [