mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-25 06:28:22 +00:00
Fix Checkstyle (#13683)
This commit is contained in:
parent
420da29841
commit
57cb72c26f
@ -23,7 +23,10 @@ from metadata.generated.schema.entity.services.connections.database.bigQueryConn
|
||||
from metadata.generated.schema.metadataIngestion.workflow import (
|
||||
Source as WorkflowSource,
|
||||
)
|
||||
from metadata.generated.schema.security.credentials.gcpValues import MultipleProjectId, GcpCredentialsValues
|
||||
from metadata.generated.schema.security.credentials.gcpValues import (
|
||||
GcpCredentialsValues,
|
||||
MultipleProjectId,
|
||||
)
|
||||
from metadata.ingestion.api.steps import InvalidSourceException
|
||||
from metadata.ingestion.ometa.ometa_api import OpenMetadata
|
||||
from metadata.ingestion.source.database.bigquery.helper import get_inspector_details
|
||||
@ -69,7 +72,7 @@ class BigqueryQueryParserSource(QueryParserSource, ABC):
|
||||
|
||||
def get_engine(self):
|
||||
if isinstance(
|
||||
self.service_connection.credentials.gcpConfig, GcpCredentialsValues
|
||||
self.service_connection.credentials.gcpConfig, GcpCredentialsValues
|
||||
) and isinstance(
|
||||
self.service_connection.credentials.gcpConfig.projectId, MultipleProjectId
|
||||
):
|
||||
|
||||
@ -46,9 +46,9 @@ mock_bq_config = {
|
||||
}
|
||||
|
||||
mock_credentials_path_bq_config = mock_bq_config
|
||||
mock_credentials_path_bq_config["source"]["serviceConnection"]["config"]["credentials"]["gcpConfig"][
|
||||
"__root__"
|
||||
] = "credentials.json"
|
||||
mock_credentials_path_bq_config["source"]["serviceConnection"]["config"]["credentials"][
|
||||
"gcpConfig"
|
||||
]["__root__"] = "credentials.json"
|
||||
|
||||
|
||||
MOCK_DB_NAME = "random-project-id"
|
||||
@ -94,10 +94,14 @@ class BigqueryLineageSourceTest(TestCase):
|
||||
@patch("metadata.ingestion.source.database.bigquery.connection.get_connection")
|
||||
@patch("metadata.ingestion.source.database.bigquery.connection.test_connection")
|
||||
@patch("metadata.ingestion.ometa.ometa_api.OpenMetadata")
|
||||
def __init__(self, methodName, get_connection, test_connection, OpenMetadata) -> None:
|
||||
def __init__(
|
||||
self, methodName, get_connection, test_connection, OpenMetadata
|
||||
) -> None:
|
||||
super().__init__(methodName)
|
||||
|
||||
self.config = OpenMetadataWorkflowConfig.parse_obj(mock_credentials_path_bq_config)
|
||||
self.config = OpenMetadataWorkflowConfig.parse_obj(
|
||||
mock_credentials_path_bq_config
|
||||
)
|
||||
self.bq_query_parser = BigqueryLineageSource(self.config.source, OpenMetadata())
|
||||
|
||||
def test_get_engine_without_project_id_specified(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user