update_metric_definition
Important
Some or all of this functionality is available as part of a preview release. The content and the functionality are subject to change.
update_metric_definition(metric_id: int, metric_properties: dict, skip_save_to_lakehouse: bool = False)
Parameters:
- metric_id (int): ID of the metric to be updated.
- metric_properties (dict): Properties to be updated.
- skip_save_to_lakehouse (bool, optional): Updates the DataFrame but doesn't save to the Lakehouse.
Description:
Updates properties of an existing metric definition. This function only updates the metric definition. To maintain data integrity and avoid stale metric data, generate the metric output for the updated metric again using the GenerateOutputForMetrics notebook so that metric output for the updated metric definition is stored in the ComputedESGMetrics table and any stale metric output is overwritten. After the output updates in the ComputedESGMetrics table, use it to update the metric output in downstream consumption use cases like visualizing metrics data with a Power BI dashboard.
Raises:
ValueError
if the metric ID isn't found.
Example usage:
metrics_manager = MetricsManager()
metric_properties = {
"measure_name": "Updated Emissions",
"dimensions": ["EmissionsAggregate[UnitOfMeasureName]", "EmissionsAggregate[ReportingPeriod]"]
}
metrics_manager.update_metric_definition(metric_id=1, metric_properties=metric_properties)