ES pipeline minor changes (#6565)

This commit is contained in:
Mayur Singal 2022-08-04 18:52:09 +05:30 committed by GitHub
parent c6d35f7c4c
commit 12f81c43f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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):

View File

@ -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(