mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-23 06:45:04 +00:00
Fix Inspector (#15997)
This commit is contained in:
parent
a4b856956d
commit
cf914dea94
@ -15,7 +15,6 @@ Hive source methods.
|
||||
from typing import Optional, Tuple
|
||||
|
||||
from pyhive.sqlalchemy_hive import HiveDialect
|
||||
from sqlalchemy.inspection import inspect
|
||||
|
||||
from metadata.generated.schema.entity.services.connections.database.hiveConnection import (
|
||||
HiveConnection,
|
||||
@ -95,4 +94,5 @@ class HiveSource(CommonDbSourceService):
|
||||
self.engine = get_metastore_connection(
|
||||
self.service_connection.metastoreConnection
|
||||
)
|
||||
self.inspector = inspect(self.engine)
|
||||
self._connection_map = {} # Lazy init as well
|
||||
self._inspector_map = {}
|
||||
|
@ -18,7 +18,7 @@ from copy import deepcopy
|
||||
from typing import Iterable, Optional
|
||||
|
||||
from pyhive.sqlalchemy_presto import PrestoDialect, _type_map
|
||||
from sqlalchemy import inspect, types, util
|
||||
from sqlalchemy import types, util
|
||||
from sqlalchemy.engine import reflection
|
||||
|
||||
from metadata.generated.schema.entity.data.database import Database
|
||||
@ -140,7 +140,8 @@ class PrestoSource(CommonDbSourceService):
|
||||
new_service_connection = deepcopy(self.service_connection)
|
||||
new_service_connection.catalog = database_name
|
||||
self.engine = get_connection(new_service_connection)
|
||||
self.inspector = inspect(self.engine)
|
||||
self._connection_map = {} # Lazy init as well
|
||||
self._inspector_map = {}
|
||||
|
||||
def get_database_names(self) -> Iterable[str]:
|
||||
configured_catalog = self.service_connection.catalog
|
||||
|
@ -13,8 +13,6 @@ SAP Hana source module
|
||||
"""
|
||||
from typing import Iterable, Optional
|
||||
|
||||
from sqlalchemy import inspect
|
||||
|
||||
from metadata.generated.schema.entity.services.connections.database.sapHanaConnection import (
|
||||
SapHanaConnection,
|
||||
)
|
||||
@ -51,7 +49,8 @@ class SaphanaSource(CommonDbSourceService):
|
||||
"""
|
||||
Check if the db is configured, or query the name
|
||||
"""
|
||||
self.inspector = inspect(self.engine)
|
||||
self._connection_map = {} # Lazy init as well
|
||||
self._inspector_map = {}
|
||||
|
||||
if getattr(self.service_connection.connection, "database"):
|
||||
yield self.service_connection.connection.database
|
||||
|
Loading…
x
Reference in New Issue
Block a user