diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/connection.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/connection.py index d1a3a5fa3b5..a6e5f5aee81 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/connection.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/connection.py @@ -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, diff --git a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py index 8be179f0b11..636641b61f8 100644 --- a/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py +++ b/ingestion/src/metadata/ingestion/source/dashboard/superset/db_source.py @@ -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