From ca88691ff44349813417bd620c12809cbf832301 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Fri, 7 Jun 2024 17:50:34 +0530 Subject: [PATCH 1/2] docs: add note for subResourceType being a fieldPath (#10660) --- docs/api/tutorials/tags.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/tutorials/tags.md b/docs/api/tutorials/tags.md index 24d583dc26dac..a97f8946991f5 100644 --- a/docs/api/tutorials/tags.md +++ b/docs/api/tutorials/tags.md @@ -275,6 +275,8 @@ Expected Response: ### Add Tags to a Column of a dataset +In the example below `subResource` is `fieldPath` in the schema. + From 6fdf2f73540a46369dd6636411ae960a6812c110 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Fri, 7 Jun 2024 17:50:49 +0530 Subject: [PATCH 2/2] fix(ingest/qlik): improve logging for debug (#10659) --- .../datahub/ingestion/source/qlik_sense/config.py | 2 ++ .../ingestion/source/qlik_sense/data_classes.py | 4 ++-- .../datahub/ingestion/source/qlik_sense/qlik_api.py | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/config.py b/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/config.py index eb0b9d02d865e..b5547e8a8ae9e 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/config.py +++ b/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/config.py @@ -93,6 +93,8 @@ class Constant: # Personal entity constants PERSONAL_SPACE_ID = "personal-space-id" PERSONAL_SPACE_NAME = "personal_space" + # Hypercube + HYPERCUBE = "qHyperCube" @dataclass diff --git a/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/data_classes.py b/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/data_classes.py index c30b456253e06..672fcbceb0603 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/data_classes.py +++ b/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/data_classes.py @@ -164,8 +164,8 @@ class Chart(BaseModel): @root_validator(pre=True) def update_values(cls, values: Dict) -> Dict: values[Constant.QID] = values[Constant.QINFO][Constant.QID] - values["qDimension"] = values["qHyperCube"]["qDimensionInfo"] - values["qMeasure"] = values["qHyperCube"]["qMeasureInfo"] + values["qDimension"] = values[Constant.HYPERCUBE]["qDimensionInfo"] + values["qMeasure"] = values[Constant.HYPERCUBE]["qMeasureInfo"] return values diff --git a/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/qlik_api.py b/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/qlik_api.py index d7a040ff5f0a0..31b0731aaa751 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/qlik_api.py +++ b/metadata-ingestion/src/datahub/ingestion/source/qlik_sense/qlik_api.py @@ -113,7 +113,13 @@ def _get_chart( method="GetChild", params={"qId": chart_id} ) response = websocket_connection.websocket_send_request(method="GetLayout") - return Chart.parse_obj(response[Constant.QLAYOUT]) + q_layout = response[Constant.QLAYOUT] + if Constant.HYPERCUBE not in q_layout: + logger.warning( + f"Chart with id {chart_id} of sheet {sheet_id} does not have hypercube. q_layout: {q_layout}" + ) + return None + return Chart.parse_obj(q_layout) except Exception as e: self._log_http_error( message=f"Unable to fetch chart {chart_id} of sheet {sheet_id}. Exception: {e}" @@ -135,6 +141,11 @@ def _get_sheet( # That means sheet is private sheet return None sheet = Sheet.parse_obj(sheet_dict[Constant.QMETA]) + if Constant.QCHILDLIST not in sheet_dict: + logger.warning( + f"Sheet {sheet.title} with id {sheet_id} does not have any charts. sheet_dict: {sheet_dict}" + ) + return sheet for i, chart_dict in enumerate( sheet_dict[Constant.QCHILDLIST][Constant.QITEMS] ):