diff --git a/ingestion/src/metadata/clients/domodashboard_client.py b/ingestion/src/metadata/clients/domodashboard_client.py index 0f982c5d77b..16bc0838b1c 100644 --- a/ingestion/src/metadata/clients/domodashboard_client.py +++ b/ingestion/src/metadata/clients/domodashboard_client.py @@ -1,3 +1,17 @@ +# Copyright 2021 Collate +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +DomoDashboard Client source to extract DOMO metadata +""" + from typing import List from metadata.generated.schema.entity.services.connections.dashboard.domodashboardConnection import ( @@ -5,12 +19,21 @@ from metadata.generated.schema.entity.services.connections.dashboard.domodashboa ) from metadata.ingestion.ometa.client import REST, ClientConfig -CARDS_URL = "cards?includeV4PageLayouts=true&parts=metadata,datasources,library,drillPathURNs,owners,certification,dateInfo,subscriptions,slicers" +CARDS_URL = ( + "cards?includeV4PageLayouts=true&parts=metadata,datasources,library,drillPathURNs" + ",owners,certification,dateInfo,subscriptions,slicers" +) + HEADERS = {"Content-Type": "application/json"} class DomoDashboardClient: + """ + Implements the necessary methods to extract + Dashboard metadata from Domo's metadata db + """ + def __init__(self, config: DomoDashboardConnection): self.config = config HEADERS.update({"X-DOMO-Developer-Token": self.config.accessToken}) @@ -28,5 +51,7 @@ class DomoDashboardClient: f"{CARDS_URL}" f"&stackLoadContext=Page&stackLoadContextId={page_id}&stackLoadTrigger=page-view" ) - response = self.client._request(method="GET", path=url, headers=HEADERS) + response = self.client._request( # pylint: disable=protected-access + method="GET", path=url, headers=HEADERS + ) return response