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