def alter_native_filters(dashboard: Dashboard) -> None:
    json_metadata = json.loads(dashboard.json_metadata)
    native_filter_configuration = json_metadata.get('native_filter_configuration')
    if (not native_filter_configuration):
        return
    for native_filter in native_filter_configuration:
        for target in native_filter.get('targets', []):
            old_dataset_id = target.get('datasetId')
            if (dataset_id_mapping and (old_dataset_id is not None)):
                target['datasetId'] = dataset_id_mapping.get(old_dataset_id, old_dataset_id)
    dashboard.json_metadata = json.dumps(json_metadata)
def alter_native_filters(dashboard: Dashboard) -> None:
    json_metadata = json.loads(dashboard.json_metadata)
    native_filter_configuration = json_metadata.get('native_filter_configuration')
    if (not native_filter_configuration):
        return
    for native_filter in native_filter_configuration:
        for target in native_filter.get('targets', []):
            old_dataset_id = target.get('datasetId')
            if (dataset_id_mapping and (old_dataset_id is not None)):
                target['datasetId'] = dataset_id_mapping.get(old_dataset_id, old_dataset_id)
    dashboard.json_metadata = json.dumps(json_metadata)