mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-29 01:32:01 +00:00
fix query for mysql con. (#18272)
This commit is contained in:
parent
dfb7a3ce9d
commit
a9a37cfd0b
@ -84,7 +84,12 @@ def test_connection(
|
||||
else:
|
||||
test_fn["CheckAccess"] = partial(test_connection_engine_step, client)
|
||||
test_fn["GetDashboards"] = partial(test_query, client, FETCH_DASHBOARDS_TEST)
|
||||
test_fn["GetCharts"] = partial(test_query, client, FETCH_ALL_CHARTS_TEST)
|
||||
if isinstance(service_connection.connection, MysqlConnection):
|
||||
test_fn["GetCharts"] = partial(
|
||||
test_query, client, FETCH_ALL_CHARTS_TEST.replace('"', "`")
|
||||
)
|
||||
else:
|
||||
test_fn["GetCharts"] = partial(test_query, client, FETCH_ALL_CHARTS_TEST)
|
||||
|
||||
test_connection_steps(
|
||||
metadata=metadata,
|
||||
|
||||
@ -26,6 +26,9 @@ from metadata.generated.schema.api.data.createDashboardDataModel import (
|
||||
from metadata.generated.schema.entity.data.chart import Chart
|
||||
from metadata.generated.schema.entity.data.dashboardDataModel import DataModelType
|
||||
from metadata.generated.schema.entity.data.table import Table
|
||||
from metadata.generated.schema.entity.services.connections.database.mysqlConnection import (
|
||||
MysqlConnection,
|
||||
)
|
||||
from metadata.generated.schema.entity.services.databaseService import DatabaseService
|
||||
from metadata.generated.schema.entity.services.ingestionPipelines.status import (
|
||||
StackTraceError,
|
||||
@ -81,7 +84,10 @@ class SupersetDBSource(SupersetSourceMixin):
|
||||
the required information which is not available in fetch_charts_with_id api
|
||||
"""
|
||||
try:
|
||||
charts = self.engine.execute(FETCH_ALL_CHARTS)
|
||||
if isinstance(self.service_connection.connection, MysqlConnection):
|
||||
charts = self.engine.execute(FETCH_ALL_CHARTS.replace('"', "`"))
|
||||
else:
|
||||
charts = self.engine.execute(FETCH_ALL_CHARTS)
|
||||
for chart in charts:
|
||||
chart_detail = FetchChart(**chart)
|
||||
self.all_charts[chart_detail.id] = chart_detail
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user