mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-31 21:03:03 +00:00
fix(ingest/qlik): improve logging for debug (#10659)
This commit is contained in:
parent
ca88691ff4
commit
6fdf2f7354
@ -93,6 +93,8 @@ class Constant:
|
|||||||
# Personal entity constants
|
# Personal entity constants
|
||||||
PERSONAL_SPACE_ID = "personal-space-id"
|
PERSONAL_SPACE_ID = "personal-space-id"
|
||||||
PERSONAL_SPACE_NAME = "personal_space"
|
PERSONAL_SPACE_NAME = "personal_space"
|
||||||
|
# Hypercube
|
||||||
|
HYPERCUBE = "qHyperCube"
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
@ -164,8 +164,8 @@ class Chart(BaseModel):
|
|||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
def update_values(cls, values: Dict) -> Dict:
|
def update_values(cls, values: Dict) -> Dict:
|
||||||
values[Constant.QID] = values[Constant.QINFO][Constant.QID]
|
values[Constant.QID] = values[Constant.QINFO][Constant.QID]
|
||||||
values["qDimension"] = values["qHyperCube"]["qDimensionInfo"]
|
values["qDimension"] = values[Constant.HYPERCUBE]["qDimensionInfo"]
|
||||||
values["qMeasure"] = values["qHyperCube"]["qMeasureInfo"]
|
values["qMeasure"] = values[Constant.HYPERCUBE]["qMeasureInfo"]
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,7 +113,13 @@ class QlikAPI:
|
|||||||
method="GetChild", params={"qId": chart_id}
|
method="GetChild", params={"qId": chart_id}
|
||||||
)
|
)
|
||||||
response = websocket_connection.websocket_send_request(method="GetLayout")
|
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:
|
except Exception as e:
|
||||||
self._log_http_error(
|
self._log_http_error(
|
||||||
message=f"Unable to fetch chart {chart_id} of sheet {sheet_id}. Exception: {e}"
|
message=f"Unable to fetch chart {chart_id} of sheet {sheet_id}. Exception: {e}"
|
||||||
@ -135,6 +141,11 @@ class QlikAPI:
|
|||||||
# That means sheet is private sheet
|
# That means sheet is private sheet
|
||||||
return None
|
return None
|
||||||
sheet = Sheet.parse_obj(sheet_dict[Constant.QMETA])
|
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(
|
for i, chart_dict in enumerate(
|
||||||
sheet_dict[Constant.QCHILDLIST][Constant.QITEMS]
|
sheet_dict[Constant.QCHILDLIST][Constant.QITEMS]
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user