mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-27 09:55:36 +00:00
fixed looker and optional proj filters (#15289)
This commit is contained in:
parent
7f111c7ed8
commit
b78e43e8d7
@ -661,7 +661,7 @@ class LookerSource(DashboardServiceSource):
|
|||||||
],
|
],
|
||||||
# Dashboards are created from the UI directly. They are not linked to a project
|
# Dashboards are created from the UI directly. They are not linked to a project
|
||||||
# like LookML assets, but rather just organised in folders.
|
# like LookML assets, but rather just organised in folders.
|
||||||
project=self._get_dashboard_project(dashboard_details),
|
project=self.get_project_name(dashboard_details),
|
||||||
sourceUrl=f"{clean_uri(self.service_connection.hostPort)}/dashboards/{dashboard_details.id}",
|
sourceUrl=f"{clean_uri(self.service_connection.hostPort)}/dashboards/{dashboard_details.id}",
|
||||||
service=self.context.dashboard_service,
|
service=self.context.dashboard_service,
|
||||||
owner=self.get_owner_ref(dashboard_details=dashboard_details),
|
owner=self.get_owner_ref(dashboard_details=dashboard_details),
|
||||||
@ -669,8 +669,7 @@ class LookerSource(DashboardServiceSource):
|
|||||||
yield Either(right=dashboard_request)
|
yield Either(right=dashboard_request)
|
||||||
self.register_record(dashboard_request=dashboard_request)
|
self.register_record(dashboard_request=dashboard_request)
|
||||||
|
|
||||||
@staticmethod
|
def get_project_name(self, dashboard_details: LookerDashboard) -> Optional[str]:
|
||||||
def _get_dashboard_project(dashboard_details: LookerDashboard) -> Optional[str]:
|
|
||||||
"""
|
"""
|
||||||
Get dashboard project if the folder is informed
|
Get dashboard project if the folder is informed
|
||||||
"""
|
"""
|
||||||
@ -680,7 +679,7 @@ class LookerSource(DashboardServiceSource):
|
|||||||
logger.debug(
|
logger.debug(
|
||||||
f"Cannot get folder name from dashboard [{dashboard_details.title}] - [{exc}]"
|
f"Cannot get folder name from dashboard [{dashboard_details.title}] - [{exc}]"
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _clean_table_name(table_name: str) -> str:
|
def _clean_table_name(table_name: str) -> str:
|
||||||
|
@ -54,6 +54,10 @@ def _filter(filter_pattern: Optional[FilterPattern], name: str) -> bool:
|
|||||||
# No filter pattern, nothing to filter
|
# No filter pattern, nothing to filter
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if filter_pattern and not name:
|
||||||
|
# Filter pattern is present but not the name so we'll filter it out
|
||||||
|
return True
|
||||||
|
|
||||||
if filter_pattern.includes:
|
if filter_pattern.includes:
|
||||||
validate_regex(filter_pattern.includes)
|
validate_regex(filter_pattern.includes)
|
||||||
return not any( # pylint: disable=use-a-generator
|
return not any( # pylint: disable=use-a-generator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user