Fix Checkstyle (#13683)

This commit is contained in:
Ayush Shah 2023-10-23 15:51:40 +05:30 committed by GitHub
parent 420da29841
commit 57cb72c26f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

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

View File

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