diff --git a/ingestion/src/metadata/ingestion/api/workflow.py b/ingestion/src/metadata/ingestion/api/workflow.py index dbbef9e6c5a..b1b798db898 100644 --- a/ingestion/src/metadata/ingestion/api/workflow.py +++ b/ingestion/src/metadata/ingestion/api/workflow.py @@ -39,7 +39,7 @@ logger = ingestion_logger() T = TypeVar("T") -SIMPLE_SOURCE = {"sample-data", "sample-usage", "metadata_elasticsearch"} +SAMPLE_SOURCE = {"sample-data", "sample-usage"} class InvalidWorkflowJSONException(Exception): @@ -258,7 +258,9 @@ class Workflow: # We override the current serviceConnection source object if source workflow service already exists in OM. # We retrieve the service connection from the secrets' manager when it is configured. Otherwise, we get it # from the service object itself. - if not self._is_sample_source(self.config.source.type): + if service_type is not ServiceType.Metadata and not self._is_sample_source( + self.config.source.type + ): metadata = OpenMetadata(config=metadata_config) service = metadata.get_by_name( get_service_class_from_service_type(service_type), @@ -273,4 +275,4 @@ class Workflow: @staticmethod def _is_sample_source(service_type): - return service_type in SIMPLE_SOURCE + return service_type in SAMPLE_SOURCE diff --git a/ingestion/src/metadata/utils/class_helper.py b/ingestion/src/metadata/utils/class_helper.py index 783488e0a06..1d425511bdd 100644 --- a/ingestion/src/metadata/utils/class_helper.py +++ b/ingestion/src/metadata/utils/class_helper.py @@ -4,9 +4,6 @@ from typing import Type from pydantic import BaseModel from metadata.generated.schema.entity.services.serviceType import ServiceType -from metadata.utils.logger import utils_logger - -logger = utils_logger() def _clean(source_type: str): diff --git a/ingestion/tests/unit/metadata/utils/test_class_helper.py b/ingestion/tests/unit/metadata/utils/test_class_helper.py index 6b3a9caf34f..5d8baa87b75 100644 --- a/ingestion/tests/unit/metadata/utils/test_class_helper.py +++ b/ingestion/tests/unit/metadata/utils/test_class_helper.py @@ -25,6 +25,7 @@ from metadata.utils.class_helper import ( ("clickhouse_usage", ServiceType.Database), ("sample-data", ServiceType.Database), ("redshift-usage", ServiceType.Database), + ("metadata_elasticsearch", ServiceType.Metadata), ], ) def test_get_service_type_from_source_type(