Fix tearDown by using the proper file loader (#17994)

This commit is contained in:
IceS2 2024-09-25 17:37:56 +02:00 committed by GitHub
parent afd7887bd8
commit d36f01abf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,9 +18,9 @@ from abc import ABC, abstractmethod
from pathlib import Path
from typing import Optional
import yaml
from sqlalchemy.engine import Engine
from metadata.config.common import load_config_file
from metadata.generated.schema.entity.services.databaseService import DatabaseService
from metadata.generated.schema.metadataIngestion.workflow import (
OpenMetadataWorkflowConfig,
@ -54,7 +54,7 @@ class CliCommonDB:
@classmethod
def tearDownClass(cls):
workflow = OpenMetadataWorkflowConfig.model_validate(
yaml.safe_load(open(cls.config_file_path))
load_config_file(Path(cls.config_file_path))
)
db_service: DatabaseService = cls.openmetadata.get_by_name(
DatabaseService, workflow.source.serviceName