| 
									
										
										
										
											2022-04-14 17:33:10 +02:00
										 |  |  | #  Copyright 2021 Collate | 
					
						
							|  |  |  | #  Licensed under the Apache License, Version 2.0 (the "License"); | 
					
						
							|  |  |  | #  you may not use this file except in compliance with the License. | 
					
						
							|  |  |  | #  You may obtain a copy of the License at | 
					
						
							|  |  |  | #  http://www.apache.org/licenses/LICENSE-2.0 | 
					
						
							|  |  |  | #  Unless required by applicable law or agreed to in writing, software | 
					
						
							|  |  |  | #  distributed under the License is distributed on an "AS IS" BASIS, | 
					
						
							|  |  |  | #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
					
						
							|  |  |  | #  See the License for the specific language governing permissions and | 
					
						
							|  |  |  | #  limitations under the License. | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | Test that we can properly parse source configs | 
					
						
							|  |  |  | """
 | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | from metadata.generated.schema.entity.services.connections.dashboard.lookerConnection import ( | 
					
						
							|  |  |  |     LookerConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.dashboard.metabaseConnection import ( | 
					
						
							|  |  |  |     MetabaseConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.dashboard.powerBIConnection import ( | 
					
						
							|  |  |  |     PowerBIConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.dashboard.redashConnection import ( | 
					
						
							|  |  |  |     RedashConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.dashboard.supersetConnection import ( | 
					
						
							|  |  |  |     SupersetConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.dashboard.tableauConnection import ( | 
					
						
							|  |  |  |     TableauConnection, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-07-01 20:21:21 +02:00
										 |  |  | from metadata.generated.schema.entity.services.connections.database import ( | 
					
						
							|  |  |  |     customDatabaseConnection, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | from metadata.generated.schema.entity.services.connections.database.azureSQLConnection import ( | 
					
						
							|  |  |  |     AzureSQLConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.bigQueryConnection import ( | 
					
						
							|  |  |  |     BigQueryConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.clickhouseConnection import ( | 
					
						
							|  |  |  |     ClickhouseConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.databricksConnection import ( | 
					
						
							|  |  |  |     DatabricksConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.db2Connection import ( | 
					
						
							|  |  |  |     Db2Connection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.deltaLakeConnection import ( | 
					
						
							|  |  |  |     DeltaLakeConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.dynamoDBConnection import ( | 
					
						
							|  |  |  |     DynamoDBConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.glueConnection import ( | 
					
						
							|  |  |  |     GlueConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.hiveConnection import ( | 
					
						
							|  |  |  |     HiveConnection, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-04-21 02:57:13 -05:00
										 |  |  | from metadata.generated.schema.entity.services.connections.database.impalaConnection import ( | 
					
						
							|  |  |  |     ImpalaConnection, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | from metadata.generated.schema.entity.services.connections.database.mariaDBConnection import ( | 
					
						
							|  |  |  |     MariaDBConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.mssqlConnection import ( | 
					
						
							|  |  |  |     MssqlConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.mysqlConnection import ( | 
					
						
							|  |  |  |     MysqlConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.oracleConnection import ( | 
					
						
							|  |  |  |     OracleConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.postgresConnection import ( | 
					
						
							|  |  |  |     PostgresConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.prestoConnection import ( | 
					
						
							|  |  |  |     PrestoConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.redshiftConnection import ( | 
					
						
							|  |  |  |     RedshiftConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.salesforceConnection import ( | 
					
						
							|  |  |  |     SalesforceConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.singleStoreConnection import ( | 
					
						
							|  |  |  |     SingleStoreConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.snowflakeConnection import ( | 
					
						
							|  |  |  |     SnowflakeConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.sqliteConnection import ( | 
					
						
							|  |  |  |     SQLiteConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.trinoConnection import ( | 
					
						
							|  |  |  |     TrinoConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.database.verticaConnection import ( | 
					
						
							|  |  |  |     VerticaConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.entity.services.connections.metadata.amundsenConnection import ( | 
					
						
							|  |  |  |     AmundsenConnection, | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | from metadata.generated.schema.metadataIngestion.workflow import ( | 
					
						
							|  |  |  |     Source as WorkflowSource, | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-04-14 17:33:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | def test_amundsen(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "amundsen", | 
					
						
							|  |  |  |         "serviceName": "local_amundsen", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Amundsen", | 
					
						
							|  |  |  |                 "username": "neo4j", | 
					
						
							|  |  |  |                 "password": "test", | 
					
						
							|  |  |  |                 "hostPort": "bolt://192.168.1.8:7687", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-04-14 17:33:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, AmundsenConnection) | 
					
						
							| 
									
										
										
										
											2022-04-14 17:33:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | def test_atlas(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							| 
									
										
										
										
											2022-04-14 17:33:10 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | def test_athena(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							| 
									
										
										
										
											2022-04-14 17:33:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | def test_azure_sql(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "azuresql", | 
					
						
							|  |  |  |         "serviceName": "azuresql", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "AzureSQL", | 
					
						
							|  |  |  |                 "hostPort": "hostPort", | 
					
						
							|  |  |  |                 "database": "database_name", | 
					
						
							|  |  |  |                 "username": "username", | 
					
						
							|  |  |  |                 "password": " password", | 
					
						
							|  |  |  |                 "driver": "ODBC Driver 17 for SQL Server", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "schemaFilterPattern": { | 
					
						
							|  |  |  |                     "excludes": [ | 
					
						
							|  |  |  |                         "mysql.*", | 
					
						
							|  |  |  |                         "information_schema.*", | 
					
						
							|  |  |  |                         "performance_schema.*", | 
					
						
							|  |  |  |                         "sys.*", | 
					
						
							|  |  |  |                     ] | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, AzureSQLConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_bigquery(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "bigquery", | 
					
						
							|  |  |  |         "serviceName": "local_bigquery", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "BigQuery", | 
					
						
							| 
									
										
										
										
											2022-04-19 12:31:34 +02:00
										 |  |  |                 "credentials": { | 
					
						
							| 
									
										
										
										
											2023-06-06 11:57:00 +05:30
										 |  |  |                     "gcpConfig": { | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                         "type": "service_account", | 
					
						
							| 
									
										
										
										
											2022-04-19 12:31:34 +02:00
										 |  |  |                         "projectId": "projectID", | 
					
						
							|  |  |  |                         "privateKeyId": "privateKeyId", | 
					
						
							|  |  |  |                         "privateKey": "privateKey", | 
					
						
							|  |  |  |                         "clientEmail": "clientEmail", | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |                         "clientId": "1234", | 
					
						
							| 
									
										
										
										
											2022-04-19 12:31:34 +02:00
										 |  |  |                         "authUri": "https://accounts.google.com/o/oauth2/auth", | 
					
						
							|  |  |  |                         "tokenUri": "https://oauth2.googleapis.com/token", | 
					
						
							|  |  |  |                         "authProviderX509CertUrl": "https://www.googleapis.com/oauth2/v1/certs", | 
					
						
							|  |  |  |                         "clientX509CertUrl": "https://cert.url", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                     } | 
					
						
							|  |  |  |                 }, | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, BigQueryConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_clickhouse(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "clickhouse", | 
					
						
							|  |  |  |         "serviceName": "local_clickhouse", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Clickhouse", | 
					
						
							|  |  |  |                 "username": "default", | 
					
						
							|  |  |  |                 "password": "", | 
					
						
							|  |  |  |                 "hostPort": "localhost:8123", | 
					
						
							| 
									
										
										
										
											2022-06-13 12:17:54 +02:00
										 |  |  |                 "databaseSchema": "default", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |                 "type": "DatabaseMetadata", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "schemaFilterPattern": { | 
					
						
							|  |  |  |                     "excludes": [ | 
					
						
							|  |  |  |                         "system.*", | 
					
						
							|  |  |  |                         "information_schema.*", | 
					
						
							|  |  |  |                         "INFORMATION_SCHEMA.*", | 
					
						
							|  |  |  |                     ] | 
					
						
							|  |  |  |                 }, | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, ClickhouseConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_databricks(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "databricks", | 
					
						
							|  |  |  |         "serviceName": "local_databricks", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "token": "<databricks token>", | 
					
						
							|  |  |  |                 "hostPort": "localhost:443", | 
					
						
							|  |  |  |                 "connectionArguments": { | 
					
						
							|  |  |  |                     "http_path": "<http path of databricks cluster>" | 
					
						
							|  |  |  |                 }, | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, DatabricksConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_db2(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "db2", | 
					
						
							|  |  |  |         "serviceName": "local_db2", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Db2", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							|  |  |  |                 "password": "openmetadata_password", | 
					
						
							|  |  |  |                 "hostPort": "localhost:50000", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "database": "db", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, Db2Connection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_deltalake(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "deltalake", | 
					
						
							|  |  |  |         "serviceName": "local_deltalake", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2024-06-20 08:38:21 +02:00
										 |  |  |                 "configSource": { | 
					
						
							|  |  |  |                     "connection": { | 
					
						
							|  |  |  |                         "metastoreDb": "jdbc:mysql://localhost:3306/demo_hive" | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     "appName": "MyApp", | 
					
						
							| 
									
										
										
										
											2022-09-20 16:47:57 +02:00
										 |  |  |                 }, | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, DeltaLakeConnection) | 
					
						
							| 
									
										
										
										
											2022-09-20 16:47:57 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "deltalake", | 
					
						
							|  |  |  |         "serviceName": "local_deltalake", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2024-06-20 08:38:21 +02:00
										 |  |  |                 "configSource": { | 
					
						
							|  |  |  |                     "connection": { | 
					
						
							|  |  |  |                         "metastoreHostPort": "localhost:9083", | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     "appName": "MyApp", | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							|  |  |  |     assert isinstance(config.serviceConnection.root.config, DeltaLakeConnection) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "deltalake", | 
					
						
							|  |  |  |         "serviceName": "local_deltalake", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "configSource": { | 
					
						
							|  |  |  |                     "connection": { | 
					
						
							|  |  |  |                         "metastoreFilePath": "/tmp/metastore.db", | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     "appName": "MyApp", | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2022-09-20 16:47:57 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, DeltaLakeConnection) | 
					
						
							| 
									
										
										
										
											2022-09-20 16:47:57 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "deltalake", | 
					
						
							|  |  |  |         "serviceName": "local_deltalake", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2024-06-20 08:38:21 +02:00
										 |  |  |                 "configSource": { | 
					
						
							|  |  |  |                     "connection": { | 
					
						
							|  |  |  |                         "securityConfig": { | 
					
						
							|  |  |  |                             "awsAccessKeyId": "access_key", | 
					
						
							|  |  |  |                             "awsSecretAccessKey": "secret_key", | 
					
						
							|  |  |  |                             "awsRegion": "us-east-2", | 
					
						
							|  |  |  |                             "awsSessionToken": "sessionToken", | 
					
						
							|  |  |  |                         } | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     "bucketName": "my-bucket", | 
					
						
							|  |  |  |                     "prefix": "prefix", | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, DeltaLakeConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_druid(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_dynamo_db(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "dynamodb", | 
					
						
							|  |  |  |         "serviceName": "local_dynamodb", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2022-04-22 11:25:05 +02:00
										 |  |  |                 "type": "DynamoDB", | 
					
						
							|  |  |  |                 "awsConfig": { | 
					
						
							|  |  |  |                     "awsAccessKeyId": "aws_access_key_id", | 
					
						
							|  |  |  |                     "awsSecretAccessKey": "aws_secret_access_key", | 
					
						
							|  |  |  |                     "awsRegion": "us-east-2", | 
					
						
							|  |  |  |                     "endPointURL": "https://dynamodb.us-east-2.amazonaws.com", | 
					
						
							|  |  |  |                 }, | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "databaseName": "custom_database_name", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |                 "type": "DatabaseMetadata", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "tableFilterPattern": {"includes": [""]}, | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, DynamoDBConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_glue(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "glue", | 
					
						
							|  |  |  |         "serviceName": "local_glue", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Glue", | 
					
						
							| 
									
										
										
										
											2022-04-22 11:25:05 +02:00
										 |  |  |                 "awsConfig": { | 
					
						
							|  |  |  |                     "awsAccessKeyId": "aws accessKey id", | 
					
						
							|  |  |  |                     "awsSecretAccessKey": "aws secret access key", | 
					
						
							|  |  |  |                     "awsRegion": "aws region", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                     "endPointURL": "https://glue.region.amazonaws.com", | 
					
						
							| 
									
										
										
										
											2022-04-22 11:25:05 +02:00
										 |  |  |                 }, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, GlueConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_hive(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "hive", | 
					
						
							|  |  |  |         "serviceName": "local_hive", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": {"type": "Hive", "hostPort": "localhost:10000"} | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, HiveConnection) | 
					
						
							| 
									
										
										
										
											2023-04-21 02:57:13 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_impala(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "impala", | 
					
						
							|  |  |  |         "serviceName": "local_impala", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": {"type": "Impala", "hostPort": "localhost:21050"} | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, ImpalaConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_kafka(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_ldap(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_looker(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "looker", | 
					
						
							|  |  |  |         "serviceName": "local_looker", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Looker", | 
					
						
							| 
									
										
										
										
											2022-07-24 16:02:26 +02:00
										 |  |  |                 "clientId": "username", | 
					
						
							|  |  |  |                 "clientSecret": "password", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "hostPort": "http://hostPort", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, LookerConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_mariadb(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "mariadb", | 
					
						
							|  |  |  |         "serviceName": "local_mariadb", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "MariaDB", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							|  |  |  |                 "password": "openmetadata_password", | 
					
						
							|  |  |  |                 "hostPort": "localhost:3306", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, MariaDBConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_mariadb(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "mariadb", | 
					
						
							|  |  |  |         "serviceName": "local_mariadb", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "MariaDB", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							|  |  |  |                 "password": "openmetadata_password", | 
					
						
							|  |  |  |                 "hostPort": "localhost:3306", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, MariaDBConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_metabase(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "metabase", | 
					
						
							|  |  |  |         "serviceName": "test", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Metabase", | 
					
						
							|  |  |  |                 "username": "username", | 
					
						
							|  |  |  |                 "password": "password", | 
					
						
							|  |  |  |                 "hostPort": "http://hostPort", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": {"dashboardFilterPattern": {}, "chartFilterPattern": {}} | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, MetabaseConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_metadata(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_mlflow(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_mssql(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "mssql", | 
					
						
							|  |  |  |         "serviceName": "local_mssql", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Mssql", | 
					
						
							|  |  |  |                 "database": "catalog_test", | 
					
						
							|  |  |  |                 "username": "sa", | 
					
						
							|  |  |  |                 "password": "test!Password", | 
					
						
							|  |  |  |                 "hostPort": "localhost:1433", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, MssqlConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_mysql(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "mysql", | 
					
						
							|  |  |  |         "serviceName": "local_mysql", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Mysql", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							| 
									
										
										
										
											2023-06-16 13:18:12 +05:30
										 |  |  |                 "authType": {"password": "openmetadata_password"}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "hostPort": "localhost:3306", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, MysqlConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_oracle(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "oracle", | 
					
						
							|  |  |  |         "serviceName": "local_oracle", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "hostPort": "hostPort", | 
					
						
							|  |  |  |                 "username": "username", | 
					
						
							|  |  |  |                 "password": "password", | 
					
						
							|  |  |  |                 "type": "Oracle", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "oracleConnectionType": {"oracleServiceName": "TESTDB"}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, OracleConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_postgres(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "postgres", | 
					
						
							|  |  |  |         "serviceName": "local_postgres", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Postgres", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "authType": { | 
					
						
							|  |  |  |                     "password": "openmetadata_password", | 
					
						
							|  |  |  |                 }, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "hostPort": "localhost:5432", | 
					
						
							|  |  |  |                 "database": "pagila", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, PostgresConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_powerbi(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "powerbi", | 
					
						
							|  |  |  |         "serviceName": "local_powerbi", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "clientId": "client_id", | 
					
						
							|  |  |  |                 "clientSecret": "client_secret", | 
					
						
							| 
									
										
										
										
											2022-06-01 14:06:12 +05:30
										 |  |  |                 "tenantId": "tenant_id", | 
					
						
							|  |  |  |                 "scope": ["https://analysis.windows.net/powerbi/api/.default"], | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "type": "PowerBI", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-01 14:06:12 +05:30
										 |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "dashboardFilterPattern": { | 
					
						
							|  |  |  |                     "includes": ["Supplier Quality Analysis Sample"] | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, PowerBIConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_presto(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "presto", | 
					
						
							|  |  |  |         "serviceName": "local_presto", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Presto", | 
					
						
							|  |  |  |                 "hostPort": "localhost:8080", | 
					
						
							|  |  |  |                 "catalog": "tpcds", | 
					
						
							|  |  |  |                 "username": "admin", | 
					
						
							|  |  |  |                 "password": "password", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {"generateSampleData": False}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, PrestoConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_redash(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "redash", | 
					
						
							|  |  |  |         "serviceName": "local_redash", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Redash", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:45:33 +02:00
										 |  |  |                 "hostPort": "http://localhost:5000", | 
					
						
							|  |  |  |                 "username": "random", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "apiKey": "api_key", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": {"dashboardFilterPattern": {}, "chartFilterPattern": {}} | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, RedashConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_redshift(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "redshift", | 
					
						
							|  |  |  |         "serviceName": "aws_redshift", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "hostPort": "cluster.name.region.redshift.amazonaws.com:5439", | 
					
						
							|  |  |  |                 "username": "username", | 
					
						
							|  |  |  |                 "password": "strong_password", | 
					
						
							|  |  |  |                 "database": "dev", | 
					
						
							|  |  |  |                 "type": "Redshift", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "schemaFilterPattern": { | 
					
						
							|  |  |  |                     "excludes": ["information_schema.*", "[\\w]*event_vw.*"] | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, RedshiftConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_s3(): | 
					
						
							|  |  |  |     """TODO""" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_salesforce(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "salesforce", | 
					
						
							|  |  |  |         "serviceName": "local_salesforce", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Salesforce", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "salesforceDomain": "localhost", | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "username": "username", | 
					
						
							|  |  |  |                 "password": "password", | 
					
						
							|  |  |  |                 "securityToken": "securityToken", | 
					
						
							|  |  |  |                 "sobjectName": "sobjectName", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, SalesforceConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_sample_data(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "sample-data", | 
					
						
							|  |  |  |         "serviceName": "sample_data", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							| 
									
										
										
										
											2023-07-01 20:21:21 +02:00
										 |  |  |                 "type": "CustomDatabase", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "sourcePythonClass": "metadata.ingestion.source.database.sample_data.SampleDataSource", | 
					
						
							|  |  |  |                 "connectionOptions": {"sampleDataFolder": "./examples/sample_data"}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2023-07-01 20:21:21 +02:00
										 |  |  |     assert isinstance( | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |         config.serviceConnection.root.config, | 
					
						
							| 
									
										
										
										
											2023-07-01 20:21:21 +02:00
										 |  |  |         customDatabaseConnection.CustomDatabaseConnection, | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_singlestore(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "singlestore", | 
					
						
							|  |  |  |         "serviceName": "local_singlestore", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "SingleStore", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							|  |  |  |                 "password": "openmetadata_password", | 
					
						
							|  |  |  |                 "hostPort": "localhost:3306", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, SingleStoreConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_snowflake(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "snowflake", | 
					
						
							|  |  |  |         "serviceName": "snowflake", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Snowflake", | 
					
						
							|  |  |  |                 "username": "username", | 
					
						
							|  |  |  |                 "password": "password", | 
					
						
							|  |  |  |                 "database": "database_name", | 
					
						
							|  |  |  |                 "warehouse": "warehouse_name", | 
					
						
							|  |  |  |                 "account": "account.region_name.cloud_service", | 
					
						
							|  |  |  |                 "connectionArguments": {"private_key": "private_key"}, | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "schemaFilterPattern": { | 
					
						
							|  |  |  |                     "excludes": [ | 
					
						
							|  |  |  |                         "mysql.*", | 
					
						
							|  |  |  |                         "information_schema.*", | 
					
						
							|  |  |  |                         "performance_schema.*", | 
					
						
							|  |  |  |                         "sys.*", | 
					
						
							|  |  |  |                     ] | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, SnowflakeConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_sqlite(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "sqlite", | 
					
						
							|  |  |  |         "serviceName": "my_service", | 
					
						
							|  |  |  |         "serviceConnection": {"config": {"type": "SQLite"}}, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, SQLiteConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_superset(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "superset", | 
					
						
							|  |  |  |         "serviceName": "local_superset", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "hostPort": "http://localhost:8080", | 
					
						
							| 
									
										
										
										
											2023-12-22 15:43:50 +01:00
										 |  |  |                 "connection": { | 
					
						
							|  |  |  |                     "provider": "db", | 
					
						
							|  |  |  |                     "username": "admin", | 
					
						
							|  |  |  |                     "password": "admin", | 
					
						
							|  |  |  |                 }, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "type": "Superset", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": {"chartFilterPattern": {}, "dashboardFilterPattern": {}} | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, SupersetConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_tableau(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "tableau", | 
					
						
							|  |  |  |         "serviceName": "local_tableau", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Tableau", | 
					
						
							| 
									
										
										
										
											2023-04-14 13:49:36 +05:30
										 |  |  |                 "authType": {"username": "username", "password": "password"}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |                 "env": "tableau_prod", | 
					
						
							|  |  |  |                 "hostPort": "http://localhost", | 
					
						
							|  |  |  |                 "siteName": "site_name", | 
					
						
							|  |  |  |                 "apiVersion": "api_version", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": { | 
					
						
							|  |  |  |             "config": {"dashboardFilterPattern": {}, "chartFilterPattern": {}} | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, TableauConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_trino(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "trino", | 
					
						
							|  |  |  |         "serviceName": "local_trino", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Trino", | 
					
						
							|  |  |  |                 "hostPort": "localhost:8080", | 
					
						
							|  |  |  |                 "username": "user", | 
					
						
							|  |  |  |                 "catalog": "tpcds", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         "sourceConfig": {"config": {}}, | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, TrinoConnection) | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_vertica(): | 
					
						
							|  |  |  |     source = { | 
					
						
							|  |  |  |         "type": "vertica", | 
					
						
							|  |  |  |         "serviceName": "local_vertica", | 
					
						
							|  |  |  |         "serviceConnection": { | 
					
						
							|  |  |  |             "config": { | 
					
						
							|  |  |  |                 "type": "Vertica", | 
					
						
							|  |  |  |                 "username": "openmetadata_user", | 
					
						
							|  |  |  |                 "password": "", | 
					
						
							|  |  |  |                 "hostPort": "localhost:5433", | 
					
						
							|  |  |  |                 "database": "custom_database_name", | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2022-06-08 16:10:40 +02:00
										 |  |  |         "sourceConfig": {"config": {"type": "DatabaseMetadata"}}, | 
					
						
							| 
									
										
										
										
											2022-04-18 16:41:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-07 04:36:17 +02:00
										 |  |  |     config: WorkflowSource = WorkflowSource.model_validate(source) | 
					
						
							| 
									
										
										
										
											2024-06-05 21:18:37 +02:00
										 |  |  |     assert isinstance(config.serviceConnection.root.config, VerticaConnection) |