From c5624dc2e9c588d384576171881dcddac3928147 Mon Sep 17 00:00:00 2001 From: SumanMaharana Date: Thu, 2 Apr 2026 16:50:55 +0530 Subject: [PATCH 1/6] FIx dataype warnings --- .../source/database/azuresql/metadata.py | 2 +- .../source/database/clickhouse/utils.py | 7 ++ .../source/database/common_pg_mappings.py | 1 + .../source/database/mssql/metadata.py | 2 +- .../source/database/starrocks/metadata.py | 10 +++ .../source/database/vertica/metadata.py | 14 ++++ ingestion/src/metadata/utils/sqa_utils.py | 4 +- .../database/test_clickhouse_utils.py | 66 +++++++++++++++ .../unit/topology/database/test_mssql.py | 50 +++++++++++ .../unit/topology/database/test_postgres.py | 27 ++++++ .../unit/topology/database/test_starrocks.py | 46 +++++++++- .../database/test_vertica_type_mapping.py | 83 +++++++++++++++++++ .../pipeline/test_service_resolver.py | 4 +- 13 files changed, 308 insertions(+), 8 deletions(-) create mode 100644 ingestion/tests/unit/topology/database/test_vertica_type_mapping.py diff --git a/ingestion/src/metadata/ingestion/source/database/azuresql/metadata.py b/ingestion/src/metadata/ingestion/source/database/azuresql/metadata.py index 69b474b0e097..c11bf83c0a2a 100644 --- a/ingestion/src/metadata/ingestion/source/database/azuresql/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/azuresql/metadata.py @@ -43,7 +43,7 @@ logger = ingestion_logger() -ischema_names = update_mssql_ischema_names(ischema_names) +update_mssql_ischema_names(ischema_names) MSDialect.get_table_comment = get_table_comment MSDialect.get_view_definition = get_view_definition diff --git a/ingestion/src/metadata/ingestion/source/database/clickhouse/utils.py b/ingestion/src/metadata/ingestion/source/database/clickhouse/utils.py index 63d9816e0f77..ee4c74ad2bb9 100644 --- a/ingestion/src/metadata/ingestion/source/database/clickhouse/utils.py +++ b/ingestion/src/metadata/ingestion/source/database/clickhouse/utils.py @@ -62,6 +62,13 @@ "UInt8": SMALLINT, "IPv4": create_sqlalchemy_type("IPv4"), "IPv6": create_sqlalchemy_type("IPv6"), + # ClickHouse geo types (v21+) + "Point": create_sqlalchemy_type("Point"), + "Ring": create_sqlalchemy_type("Ring"), + "Polygon": create_sqlalchemy_type("Polygon"), + "MultiPolygon": create_sqlalchemy_type("MultiPolygon"), + "LineString": create_sqlalchemy_type("LineString"), + "MultiLineString": create_sqlalchemy_type("MultiLineString"), } ) diff --git a/ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py b/ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py index 839880ba62ca..2890a245a005 100644 --- a/ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py +++ b/ingestion/src/metadata/ingestion/source/database/common_pg_mappings.py @@ -43,6 +43,7 @@ "pg_snapshot": create_sqlalchemy_type("PG_SNAPSHOT"), "tsquery": create_sqlalchemy_type("TSQUERY"), "txid_snapshot": create_sqlalchemy_type("TXID_SNAPSHOT"), + "tid": SqlAlchemyString, "xid": SqlAlchemyString, "xml": create_sqlalchemy_type("XML"), # PostgreSQL range types (used by TimescaleDB for chunk boundaries) diff --git a/ingestion/src/metadata/ingestion/source/database/mssql/metadata.py b/ingestion/src/metadata/ingestion/source/database/mssql/metadata.py index 747d8ef3ddc8..e497e4c8646b 100644 --- a/ingestion/src/metadata/ingestion/source/database/mssql/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/mssql/metadata.py @@ -75,7 +75,7 @@ # Avoid using these data types in new development work, and plan to modify applications that currently use them. # Use nvarchar(max), varchar(max), and varbinary(max) instead. # ref: https://learn.microsoft.com/en-us/sql/t-sql/data-types/ntext-text-and-image-transact-sql?view=sql-server-ver16 -ischema_names = update_mssql_ischema_names(ischema_names) +update_mssql_ischema_names(ischema_names) MSDialect.get_table_comment = get_table_comment MSDialect.get_view_definition = get_view_definition diff --git a/ingestion/src/metadata/ingestion/source/database/starrocks/metadata.py b/ingestion/src/metadata/ingestion/source/database/starrocks/metadata.py index 633753c38da0..903902c49c1d 100644 --- a/ingestion/src/metadata/ingestion/source/database/starrocks/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/starrocks/metadata.py @@ -93,8 +93,12 @@ def _get_sqlalchemy_type(type_str): type_mapping = { "VARCHAR": sqltypes.VARCHAR, "CHAR": sqltypes.CHAR, + "TINYINT": sqltypes.SMALLINT, + "SMALLINT": sqltypes.SMALLINT, "INT": sqltypes.INT, + "INTEGER": sqltypes.INTEGER, "BIGINT": sqltypes.BIGINT, + "LARGEINT": sqltypes.BIGINT, "FLOAT": sqltypes.FLOAT, "DOUBLE": sqltypes.FLOAT, "DECIMAL": sqltypes.DECIMAL, @@ -103,11 +107,17 @@ def _get_sqlalchemy_type(type_str): "TIMESTAMP": sqltypes.TIMESTAMP, "BOOLEAN": sqltypes.BOOLEAN, "ARRAY": sqltypes.ARRAY, + "MAP": sqltypes.TEXT, + "STRUCT": sqltypes.TEXT, "JSON": sqltypes.JSON, "STRING": sqltypes.TEXT, "BINARY": sqltypes.BINARY, "VARBINARY": sqltypes.VARBINARY, "TEXT": sqltypes.TEXT, + # StarRocks specialised analytics types — no SQL equivalent; store as TEXT + "BITMAP": sqltypes.TEXT, + "HLL": sqltypes.TEXT, + "PERCENTILE": sqltypes.TEXT, "UNKNOWN": sqltypes.NullType, } diff --git a/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py b/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py index cfeb06e635e3..8effddff48e5 100644 --- a/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py @@ -56,6 +56,20 @@ { "UUID": create_sqlalchemy_type("UUID"), "GEOGRAPHY": create_sqlalchemy_type("GEOGRAPHY"), + "GEOMETRY": create_sqlalchemy_type("GEOMETRY"), + # Binary types + "BINARY": sqltypes.LargeBinary, + "VARBINARY": sqltypes.LargeBinary, + "LONG VARBINARY": sqltypes.LargeBinary, + # Long string + "LONG VARCHAR": sqltypes.Text, + # Temporal + "INTERVAL": sqltypes.Interval, + # Complex / semi-structured types (Vertica v11+) + "ARRAY": create_sqlalchemy_type("ARRAY"), + "NATIVE ARRAY": create_sqlalchemy_type("ARRAY"), + "ROW": create_sqlalchemy_type("ROW"), + "SET": create_sqlalchemy_type("SET"), } ) diff --git a/ingestion/src/metadata/utils/sqa_utils.py b/ingestion/src/metadata/utils/sqa_utils.py index 2a4b57241433..14294f0a6b5d 100644 --- a/ingestion/src/metadata/utils/sqa_utils.py +++ b/ingestion/src/metadata/utils/sqa_utils.py @@ -256,8 +256,8 @@ def is_array(kwargs: Dict) -> bool: return False -def update_mssql_ischema_names(ischema_names): - return ischema_names.update( +def update_mssql_ischema_names(ischema_names: dict) -> None: + ischema_names.update( { "nvarchar": create_sqlalchemy_type("NVARCHAR"), "nchar": create_sqlalchemy_type("NCHAR"), diff --git a/ingestion/tests/unit/topology/database/test_clickhouse_utils.py b/ingestion/tests/unit/topology/database/test_clickhouse_utils.py index 70f90d1df05f..8a97f303ea5c 100644 --- a/ingestion/tests/unit/topology/database/test_clickhouse_utils.py +++ b/ingestion/tests/unit/topology/database/test_clickhouse_utils.py @@ -68,3 +68,69 @@ def test_nullable_unwraps_to_inner_type(self): def test_unknown_type_returns_null_type(self): result = self.dialect._get_column_type("col", "SomeUnknownType") assert result is sqltypes.NullType + + +class TestClickhouseGeoTypes: + """Verify that ClickHouse geo types are registered in ischema_names + and resolved correctly by _get_column_type.""" + + def setup_method(self): + self.dialect = MockDialect() + + # --- Registration checks --- + + def test_geo_types_registered_in_ischema_names(self): + for geo_type in ( + "Point", + "Ring", + "Polygon", + "MultiPolygon", + "LineString", + "MultiLineString", + ): + assert ( + geo_type in ch_ischema_names + ), f"{geo_type} not found in ischema_names" + + # --- Resolution via _get_column_type --- + + def test_point_type_resolves(self): + result = self.dialect._get_column_type("col", "Point") + assert result == ch_ischema_names["Point"] + + def test_ring_type_resolves(self): + result = self.dialect._get_column_type("col", "Ring") + assert result == ch_ischema_names["Ring"] + + def test_polygon_type_resolves(self): + result = self.dialect._get_column_type("col", "Polygon") + assert result == ch_ischema_names["Polygon"] + + def test_multipolygon_type_resolves(self): + result = self.dialect._get_column_type("col", "MultiPolygon") + assert result == ch_ischema_names["MultiPolygon"] + + def test_linestring_type_resolves(self): + result = self.dialect._get_column_type("col", "LineString") + assert result == ch_ischema_names["LineString"] + + def test_multilinestring_type_resolves(self): + result = self.dialect._get_column_type("col", "MultiLineString") + assert result == ch_ischema_names["MultiLineString"] + + def test_geo_types_are_distinct(self): + """Each geo type should resolve to a different object.""" + types = { + name: ch_ischema_names[name] + for name in ( + "Point", + "Ring", + "Polygon", + "MultiPolygon", + "LineString", + "MultiLineString", + ) + } + # All values should be distinct from NullType + for name, t in types.items(): + assert t is not sqltypes.NullType, f"{name} resolved to NullType" diff --git a/ingestion/tests/unit/topology/database/test_mssql.py b/ingestion/tests/unit/topology/database/test_mssql.py index 2ad35dc095e6..f4e90a035608 100644 --- a/ingestion/tests/unit/topology/database/test_mssql.py +++ b/ingestion/tests/unit/topology/database/test_mssql.py @@ -45,6 +45,7 @@ from metadata.generated.schema.type.filterPattern import FilterPattern from metadata.ingestion.ometa.utils import model_str from metadata.ingestion.source.database.mssql.metadata import MssqlSource +from metadata.utils.sqa_utils import update_mssql_ischema_names mock_mssql_config = { "source": { @@ -327,3 +328,52 @@ def test_get_stored_procedures(self): self.assertEqual(len(results), 1) self.assertEqual(results[0].name, "sp_include") + + +class TestUpdateMssqlIschemaNames: + """Verify update_mssql_ischema_names mutates the dict in-place and returns None.""" + + EXPECTED_MSSQL_TYPES = [ + "nvarchar", + "nchar", + "ntext", + "bit", + "image", + "binary", + "smallmoney", + "money", + "real", + "smalldatetime", + "datetime2", + "datetimeoffset", + "sql_variant", + "uniqueidentifier", + "xml", + "hierarchyid", + "geography", + "geometry", + ] + + def test_returns_none(self): + result = update_mssql_ischema_names({}) + assert result is None + + def test_mutates_dict_in_place(self): + target = {} + update_mssql_ischema_names(target) + for type_key in self.EXPECTED_MSSQL_TYPES: + assert ( + type_key in target + ), f"'{type_key}' was not added by update_mssql_ischema_names" + + def test_all_added_types_are_not_none(self): + target = {} + update_mssql_ischema_names(target) + for type_key in self.EXPECTED_MSSQL_TYPES: + assert target[type_key] is not None, f"'{type_key}' was mapped to None" + + def test_does_not_overwrite_existing_entries(self): + sentinel = object() + target = {"existing_key": sentinel} + update_mssql_ischema_names(target) + assert target["existing_key"] is sentinel diff --git a/ingestion/tests/unit/topology/database/test_postgres.py b/ingestion/tests/unit/topology/database/test_postgres.py index 33a87c16b2a2..60da236a337e 100644 --- a/ingestion/tests/unit/topology/database/test_postgres.py +++ b/ingestion/tests/unit/topology/database/test_postgres.py @@ -923,3 +923,30 @@ def test_mark_deleted_databases_with_multiple_databases(self): self.assertEqual( call_args[1]["entity_source_state"], expected_source_state ) + + +class TestPostgresCommonMappings(TestCase): + """Verify extended type entries in the shared PostgreSQL ischema_names map.""" + + def test_tid_type_registered(self): + """'tid' must be present in the PostgreSQL ischema_names after common_pg_mappings is loaded.""" + # common_pg_mappings registers types as a side-effect of module import + from sqlalchemy.dialects.postgresql.base import ( + ischema_names as pg_ischema_names, + ) + + import metadata.ingestion.source.database.common_pg_mappings # noqa: F401 + + self.assertIn("tid", pg_ischema_names) + + def test_tid_maps_to_string(self): + """'tid' must map to a String-compatible SQLAlchemy type.""" + from sqlalchemy import String as SqlAlchemyString + from sqlalchemy.dialects.postgresql.base import ( + ischema_names as pg_ischema_names, + ) + + import metadata.ingestion.source.database.common_pg_mappings # noqa: F401 + + tid_type = pg_ischema_names["tid"] + self.assertIs(tid_type, SqlAlchemyString) diff --git a/ingestion/tests/unit/topology/database/test_starrocks.py b/ingestion/tests/unit/topology/database/test_starrocks.py index efca6d4dea28..52753084a9e6 100644 --- a/ingestion/tests/unit/topology/database/test_starrocks.py +++ b/ingestion/tests/unit/topology/database/test_starrocks.py @@ -16,10 +16,16 @@ from unittest import TestCase from unittest.mock import patch +import pytest +from sqlalchemy import types as sqltypes + from metadata.generated.schema.metadataIngestion.workflow import ( OpenMetadataWorkflowConfig, ) -from metadata.ingestion.source.database.starrocks.metadata import StarRocksSource +from metadata.ingestion.source.database.starrocks.metadata import ( + StarRocksSource, + _get_sqlalchemy_type, +) mock_starrocks_config = { "source": { @@ -127,3 +133,41 @@ def __init__(self, methodName, test_connection) -> None: def test_ssl_manager_initialized(self): """Test that SSL manager is initialized when SSL config is provided""" self.assertIsNotNone(self.starrocks_source.ssl_manager) + + +class TestStarRocksTypeMappings: + """Verify _get_sqlalchemy_type returns the correct SQLAlchemy type for every + type added in the recent type-mapping expansion.""" + + @pytest.mark.parametrize( + "type_str, expected_sqa_class", + [ + # Integer family + ("TINYINT", sqltypes.SMALLINT), + ("SMALLINT", sqltypes.SMALLINT), + ("INTEGER", sqltypes.INTEGER), + ("INT", sqltypes.INT), + ("BIGINT", sqltypes.BIGINT), + ("LARGEINT", sqltypes.BIGINT), + # Analytics / semi-structured types stored as TEXT + ("MAP", sqltypes.TEXT), + ("STRUCT", sqltypes.TEXT), + ("BITMAP", sqltypes.TEXT), + ("HLL", sqltypes.TEXT), + ("PERCENTILE", sqltypes.TEXT), + # Existing string types (regression guard) + ("STRING", sqltypes.TEXT), + ("TEXT", sqltypes.TEXT), + ("JSON", sqltypes.JSON), + ], + ) + def test_type_resolves_to_expected_class(self, type_str, expected_sqa_class): + result = _get_sqlalchemy_type(type_str) + assert isinstance(result, expected_sqa_class), ( + f"_get_sqlalchemy_type('{type_str}') returned {type(result).__name__}, " + f"expected {expected_sqa_class.__name__}" + ) + + def test_unknown_type_returns_null_type(self): + result = _get_sqlalchemy_type("UNKNOWN_CUSTOM_TYPE") + assert isinstance(result, sqltypes.NullType) diff --git a/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py b/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py new file mode 100644 index 000000000000..b0cfa6b23749 --- /dev/null +++ b/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py @@ -0,0 +1,83 @@ +# Copyright 2025 Collate +# Licensed under the Collate Community License, Version 1.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# https://github.com/open-metadata/OpenMetadata/blob/main/ingestion/LICENSE +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Tests for Vertica ischema_names type mapping extensions.""" + +import pytest +from sqlalchemy import types as sqltypes + +sqlalchemy_vertica = pytest.importorskip( + "sqlalchemy_vertica", + reason="sqlalchemy_vertica not installed — skipping Vertica type-mapping tests", +) + +from sqlalchemy_vertica.base import ischema_names as vertica_ischema_names + +# Importing this module triggers the ischema_names.update(...) side-effect +import metadata.ingestion.source.database.vertica.metadata # noqa: F401 + + +class TestVerticaTypeMappingRegistered: + """Verify every new type key was added to Vertica's ischema_names.""" + + @pytest.mark.parametrize( + "type_key", + [ + "UUID", + "GEOGRAPHY", + "GEOMETRY", + "BINARY", + "VARBINARY", + "LONG VARBINARY", + "LONG VARCHAR", + "INTERVAL", + "ARRAY", + "NATIVE ARRAY", + "ROW", + "SET", + ], + ) + def test_type_key_registered(self, type_key): + assert ( + type_key in vertica_ischema_names + ), f"'{type_key}' is missing from Vertica ischema_names" + + +class TestVerticaTypeMappingResolution: + """Verify each new type resolves to the expected SQLAlchemy supertype.""" + + @pytest.mark.parametrize( + "type_key, expected_sqa_class", + [ + ("BINARY", sqltypes.LargeBinary), + ("VARBINARY", sqltypes.LargeBinary), + ("LONG VARBINARY", sqltypes.LargeBinary), + ("LONG VARCHAR", sqltypes.Text), + ("INTERVAL", sqltypes.Interval), + ], + ) + def test_standard_type_resolves_to_expected_class( + self, type_key, expected_sqa_class + ): + entry = vertica_ischema_names[type_key] + assert ( + entry is expected_sqa_class + ), f"'{type_key}' expected {expected_sqa_class.__name__}, got {entry}" + + @pytest.mark.parametrize( + "type_key", + ["GEOMETRY", "ARRAY", "NATIVE ARRAY", "ROW", "SET", "UUID", "GEOGRAPHY"], + ) + def test_custom_type_is_not_null_type(self, type_key): + entry = vertica_ischema_names[type_key] + instance = entry() if isinstance(entry, type) else entry + assert not isinstance( + instance, sqltypes.NullType + ), f"'{type_key}' resolved to NullType — custom type was not registered" diff --git a/ingestion/tests/unit/topology/pipeline/test_service_resolver.py b/ingestion/tests/unit/topology/pipeline/test_service_resolver.py index 0c3a89927e7c..52a92f5c736f 100644 --- a/ingestion/tests/unit/topology/pipeline/test_service_resolver.py +++ b/ingestion/tests/unit/topology/pipeline/test_service_resolver.py @@ -2,9 +2,7 @@ Tests for the OpenLineage service resolver module. """ -from unittest.mock import MagicMock, patch - -import pytest +from unittest.mock import MagicMock from metadata.generated.schema.entity.services.pipelineService import ( PipelineServiceType, From bfe472fe35fd1ad2b93db3b2863a4a4052634ebf Mon Sep 17 00:00:00 2001 From: Suman Maharana Date: Sun, 5 Apr 2026 01:56:23 +0530 Subject: [PATCH 2/6] Update ingestion/tests/unit/topology/database/test_starrocks.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ingestion/tests/unit/topology/database/test_starrocks.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/ingestion/tests/unit/topology/database/test_starrocks.py b/ingestion/tests/unit/topology/database/test_starrocks.py index f94469726e3d..b761225e132a 100644 --- a/ingestion/tests/unit/topology/database/test_starrocks.py +++ b/ingestion/tests/unit/topology/database/test_starrocks.py @@ -171,8 +171,6 @@ def test_type_resolves_to_expected_class(self, type_str, expected_sqa_class): def test_unknown_type_returns_null_type(self): result = _get_sqlalchemy_type("UNKNOWN_CUSTOM_TYPE") assert isinstance(result, sqltypes.NullType) - - class TestStarRocksIcebergMapping(TestCase): def test_iceberg_relkind_mapping(self): from metadata.generated.schema.entity.data.table import TableType From 618ed1735738470e4532d801c44e72a3f8eaeb75 Mon Sep 17 00:00:00 2001 From: SumanMaharana Date: Sun, 5 Apr 2026 12:06:16 +0530 Subject: [PATCH 3/6] checkstyle --- ingestion/tests/unit/topology/database/test_starrocks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ingestion/tests/unit/topology/database/test_starrocks.py b/ingestion/tests/unit/topology/database/test_starrocks.py index b761225e132a..c6ad91ebe57d 100644 --- a/ingestion/tests/unit/topology/database/test_starrocks.py +++ b/ingestion/tests/unit/topology/database/test_starrocks.py @@ -171,6 +171,8 @@ def test_type_resolves_to_expected_class(self, type_str, expected_sqa_class): def test_unknown_type_returns_null_type(self): result = _get_sqlalchemy_type("UNKNOWN_CUSTOM_TYPE") assert isinstance(result, sqltypes.NullType) + + class TestStarRocksIcebergMapping(TestCase): def test_iceberg_relkind_mapping(self): from metadata.generated.schema.entity.data.table import TableType From 0b0277b8e11b597c0d887497f17cfeb43ee37e28 Mon Sep 17 00:00:00 2001 From: SumanMaharana Date: Mon, 6 Apr 2026 21:59:09 +0530 Subject: [PATCH 4/6] checkstyle --- ingestion/tests/unit/topology/database/test_mssql.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingestion/tests/unit/topology/database/test_mssql.py b/ingestion/tests/unit/topology/database/test_mssql.py index e10e018dd9a2..73dd3aa48469 100644 --- a/ingestion/tests/unit/topology/database/test_mssql.py +++ b/ingestion/tests/unit/topology/database/test_mssql.py @@ -45,12 +45,12 @@ from metadata.generated.schema.type.filterPattern import FilterPattern from metadata.ingestion.ometa.utils import model_str from metadata.ingestion.source.database.mssql.metadata import MssqlSource -from metadata.utils.sqa_utils import update_mssql_ischema_names from metadata.ingestion.source.database.mssql.queries import ( MSSQL_GET_CURRENT_DATABASE, MSSQL_GET_DATABASE, MSSQL_TEST_GET_QUERIES, ) +from metadata.utils.sqa_utils import update_mssql_ischema_names mock_mssql_config = { "source": { @@ -382,7 +382,7 @@ def test_does_not_overwrite_existing_entries(self): target = {"existing_key": sentinel} update_mssql_ischema_names(target) assert target["existing_key"] is sentinel - + @patch( "metadata.ingestion.source.database.mssql.connection.test_connection_db_common" ) From 473812552d31bb7b7f35766c6d429c188db06d71 Mon Sep 17 00:00:00 2001 From: Suman Maharana Date: Tue, 7 Apr 2026 01:02:54 +0530 Subject: [PATCH 5/6] Update ingestion/src/metadata/ingestion/source/database/vertica/metadata.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../src/metadata/ingestion/source/database/vertica/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py b/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py index 8effddff48e5..d03abc163367 100644 --- a/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py @@ -64,7 +64,7 @@ # Long string "LONG VARCHAR": sqltypes.Text, # Temporal - "INTERVAL": sqltypes.Interval, + "INTERVAL": create_sqlalchemy_type("INTERVAL"), # Complex / semi-structured types (Vertica v11+) "ARRAY": create_sqlalchemy_type("ARRAY"), "NATIVE ARRAY": create_sqlalchemy_type("ARRAY"), From eed2315304e78fd0aad8a4b5b8268688ac3176d1 Mon Sep 17 00:00:00 2001 From: SumanMaharana Date: Tue, 7 Apr 2026 14:25:17 +0530 Subject: [PATCH 6/6] address comments --- .../src/metadata/ingestion/source/database/vertica/metadata.py | 2 -- .../tests/unit/topology/database/test_vertica_type_mapping.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py b/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py index d03abc163367..db63becdf1e2 100644 --- a/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py +++ b/ingestion/src/metadata/ingestion/source/database/vertica/metadata.py @@ -63,8 +63,6 @@ "LONG VARBINARY": sqltypes.LargeBinary, # Long string "LONG VARCHAR": sqltypes.Text, - # Temporal - "INTERVAL": create_sqlalchemy_type("INTERVAL"), # Complex / semi-structured types (Vertica v11+) "ARRAY": create_sqlalchemy_type("ARRAY"), "NATIVE ARRAY": create_sqlalchemy_type("ARRAY"), diff --git a/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py b/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py index b0cfa6b23749..4a5f676f56b1 100644 --- a/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py +++ b/ingestion/tests/unit/topology/database/test_vertica_type_mapping.py @@ -37,7 +37,6 @@ class TestVerticaTypeMappingRegistered: "VARBINARY", "LONG VARBINARY", "LONG VARCHAR", - "INTERVAL", "ARRAY", "NATIVE ARRAY", "ROW", @@ -60,7 +59,6 @@ class TestVerticaTypeMappingResolution: ("VARBINARY", sqltypes.LargeBinary), ("LONG VARBINARY", sqltypes.LargeBinary), ("LONG VARCHAR", sqltypes.Text), - ("INTERVAL", sqltypes.Interval), ], ) def test_standard_type_resolves_to_expected_class(