MINOR: Fix issue with SQLAlchemy types not being correctly mapped to OM Type on the profiler (#16122)

* Fix issue with SQLAlchemy types not being correctly mapped to OM Types on the profiler

* Fix checkstyle
This commit is contained in:
IceS2 2024-05-03 17:05:52 +02:00 committed by GitHub
parent 215a274bd0
commit 795879d776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -168,7 +168,9 @@ class MetricFilter:
if not isinstance(column, SQALikeColumn):
mapper = converter_registry[service_type]
sqa_to_om_types = mapper.map_sqa_to_om_types()
om_data_types: Optional[Set] = sqa_to_om_types.get(column.type, None)
om_data_types: Optional[Set] = sqa_to_om_types.get(
column.type.__class__, None
)
else:
om_data_types = {column.type}

View File

@ -112,7 +112,7 @@ class TestSQAProfiler(TestCase):
tables: List[Table] = self.metadata.list_all_entities(Table)
for table in tables:
if table.name != "users":
if table.name.__root__ != "users":
continue
table = self.metadata.get_latest_table_profile(table.fullyQualifiedName)
columns = table.columns
@ -162,7 +162,7 @@ class TestSQAProfiler(TestCase):
tables: List[Table] = self.metadata.list_all_entities(Table)
for table in tables:
if table.name != "users":
if table.name.__root__ != "users":
continue
table = self.metadata.get_latest_table_profile(table.fullyQualifiedName)
columns = table.columns