2024-12-10 19:09:00 +01:00

6.8 KiB

title slug
Data Insight Mixin /sdk/python/api-reference/data-insight-mixin

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

module data_insight_mixin

Mixin class containing data specific methods

To be used by OpenMetadata class


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

class DataInsightMixin

data insight mixin used to write results


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method add_data_insight_report_data

add_data_insight_report_data(record: 'ReportData')  ReportData

Given a ReportData object convert it to a json payload and send a POST request to the report data endpoint

Args:

  • record (ReportData): report data

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method add_kpi_result

add_kpi_result(fqn: 'str', record: 'KpiResult')  KpiResult

Given a ReportData object convert it to a json payload and send a POST request to the report data endpoint

Args:

  • record (ReportData): report data

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method add_web_analytic_events

add_web_analytic_events(
    event_data: 'WebAnalyticEventData'
)  List[WebAnalyticEventData]

Get web analytic event


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method create_kpi

create_kpi(create: 'CreateKpiRequest')  Kpi

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method delete_report_data

delete_report_data(report_data_type: 'ReportDataType')  None

Delete report data for a specific report data type

Args:

  • report_data_type (ReportDataType): report date type to delete

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method delete_report_data_at_date

delete_report_data_at_date(
    report_data_type: 'ReportDataType',
    date: 'str'
)  None

Delete report data at a specific date for a specific report data type

Args:

  • report_data_type (ReportDataType): report date type to delete
  • date (str): date for which to delete the report data

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method delete_web_analytic_event_before_ts_exclusive

delete_web_analytic_event_before_ts_exclusive(
    event_type: 'WebAnalyticEventType',
    tmsp: 'int'
)

Deletes web analytics events before a timestamp

Args:

  • event_type (WebAnalyticEventData): web analytic event type
  • tmsp (int): timestamp

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method get_aggregated_data_insight_results

get_aggregated_data_insight_results(
    start_ts: 'int',
    end_ts: 'int',
    data_insight_chart_name: 'str',
    data_report_index: 'str',
    params: 'Optional[dict]' = None
)  DataInsightChartResult

summary

Args:

  • start_ts (int): description
  • end_ts (int): description
  • data_insight_chart_name (str): description
  • data_report_index (str): description
  • params (Optional[dict], optional): description. Defaults to None.

Returns:

  • DataInsightChartResult: description

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method get_data_insight_report_data

get_data_insight_report_data(
    start_ts: 'int',
    end_ts: 'int',
    report_data_type: 'str'
)  dict[str, list[ReportData]]

Return dict with a list of report data given a start and end date

Args:

  • start_ts (type): start_timestamp
  • end_ts (type): end timestampe
  • report_data_type (ReportDataType): report data type

Returns: List[ReportData]:


{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method get_kpi_result

get_kpi_result(fqn: 'str', start_ts, end_ts)  list[KpiResult]

Given FQN return KPI results

Args:

  • fqn (str): fullyQualifiedName

{% image align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square" /%}

method get_web_analytic_events

get_web_analytic_events(
    event_type: 'WebAnalyticEventType',
    start_ts: 'int',
    end_ts: 'int'
)  List[WebAnalyticEventData]

Get web analytic event