def delete_config(id):
     app.logger.info(f"Removing config {id}")
     config, dataset = Dataset.config_from_id(id)
     config.delete_data()
     dataset.configs = [c for c in dataset.configs if c.id != config.id]
     dataset.save()
     return jsonify({})
 def create_model(id):
     config, dataset = Dataset.config_from_id(id)
     app.logger.info(f"Creating model with config: {request.json}")
     model = DatasetModel(model_config=request.json)
     config.models.append(model)
     dataset.save()
     return model.to_json(), 201
 def lint_config_from_db(id):
     config, dataset = Dataset.config_from_id(id)
     return lint_config(config, dataset)
 def get_config_visualization(id):
     config, d = Dataset.config_from_id(id)
     path = dataset.get_dataset_visualization(Path(d.path), d, config)
     return send_file(path)
 def get_dataset_config(id):
     config, _ = Dataset.config_from_id(id)
     return config.to_json()