diff --git a/metadata-ingestion/src/datahub/ingestion/source/looker/looker_source.py b/metadata-ingestion/src/datahub/ingestion/source/looker/looker_source.py index 0411a85b5d23ad..ef329da930dda4 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/looker/looker_source.py +++ b/metadata-ingestion/src/datahub/ingestion/source/looker/looker_source.py @@ -96,13 +96,11 @@ ChartTypeClass, ContainerClass, DashboardInfoClass, - DataPlatformInfoClass, InputFieldClass, InputFieldsClass, OwnerClass, OwnershipClass, OwnershipTypeClass, - PlatformTypeClass, SubTypesClass, ) from datahub.utilities.backpressure_aware_executor import BackpressureAwareExecutor @@ -1573,13 +1571,6 @@ def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]: looker_dashboards_for_usage: List[looker_usage.LookerDashboardForUsage] = [] - # Emit platform instance entity - if self.source_config.platform_instance: - platform_instance_urn = builder.make_dataplatform_instance_urn( - platform=self.source_config.platform_name, - instance=self.source_config.platform_instance, - ) - with self.reporter.report_stage("dashboard_chart_metadata"): for job in BackpressureAwareExecutor.map( self.process_dashboard, diff --git a/metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py b/metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py index d4da136097214e..99f83b5e922bad 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py +++ b/metadata-ingestion/src/datahub/ingestion/source/looker/looker_template_language.py @@ -10,9 +10,6 @@ create_template, ) from datahub.ingestion.source.looker.lookml_config import DERIVED_VIEW_PATTERN -from datahub.ingestion.source.looker.str_functions import ( - remove_extra_spaces_and_newlines, -) logger = logging.getLogger(__name__) diff --git a/metadata-ingestion/src/datahub/ingestion/source/looker/lookml_concept_context.py b/metadata-ingestion/src/datahub/ingestion/source/looker/lookml_concept_context.py index 599c0a655631fd..7805b8b7b7d9a5 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/looker/lookml_concept_context.py +++ b/metadata-ingestion/src/datahub/ingestion/source/looker/lookml_concept_context.py @@ -3,8 +3,6 @@ import re from typing import Any, Dict, List, Optional -import sqlglot - from datahub.ingestion.source.looker.looker_common import ( ViewFieldValue, find_view_from_resolved_includes, @@ -13,13 +11,14 @@ from datahub.ingestion.source.looker.looker_dataclasses import LookerViewFile from datahub.ingestion.source.looker.looker_file_loader import LookerViewFileLoader from datahub.ingestion.source.looker.lookml_config import ( - DERIVED_VIEW_PATTERN, DERIVED_VIEW_SUFFIX, NAME, LookMLSourceReport, ) from datahub.ingestion.source.looker.lookml_refinement import LookerRefinementResolver -from datahub.ingestion.source.looker.str_functions import remove_extra_spaces_and_newlines +from datahub.ingestion.source.looker.str_functions import ( + remove_extra_spaces_and_newlines, +) logger = logging.getLogger(__name__) @@ -462,7 +461,7 @@ def is_direct_sql_query_case(self) -> bool: # Applying a simple logic to check if sql_table_name contains a sql. # if sql_table_name contains sql then its value starts with "(" and checking if "select" is present in side the # text - if self.sql_table_name().strip().startswith("(") and "select" in self.sql_table_name(): - return True - - return False + return ( + self.sql_table_name().strip().startswith("(") + and "select" in self.sql_table_name() + ) diff --git a/metadata-ingestion/tests/integration/looker/golden_test_ingest.json b/metadata-ingestion/tests/integration/looker/golden_test_ingest.json index 76c8f04e8447a7..9c0363e0892f0d 100644 --- a/metadata-ingestion/tests/integration/looker/golden_test_ingest.json +++ b/metadata-ingestion/tests/integration/looker/golden_test_ingest.json @@ -1,22 +1,4 @@ [ -{ - "entityType": "dataPlatformInstance", - "entityUrn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:looker,ap-south-1)", - "changeType": "UPSERT", - "aspectName": "dataPlatformInfo", - "aspect": { - "json": { - "name": "ap-south-1", - "type": "OTHERS", - "datasetNameDelimiter": "." - } - }, - "systemMetadata": { - "lastObserved": 1586847600000, - "runId": "looker-test", - "lastRunId": "no-run-id-provided" - } -}, { "entityType": "container", "entityUrn": "urn:li:container:e7fe6fc9c3ca70e78694dcc5dd9c05b7", @@ -805,22 +787,6 @@ "lastRunId": "no-run-id-provided" } }, -{ - "entityType": "dataPlatformInstance", - "entityUrn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:looker,ap-south-1)", - "changeType": "UPSERT", - "aspectName": "status", - "aspect": { - "json": { - "removed": false - } - }, - "systemMetadata": { - "lastObserved": 1586847600000, - "runId": "looker-test", - "lastRunId": "no-run-id-provided" - } -}, { "entityType": "tag", "entityUrn": "urn:li:tag:Dimension",