def set_dataset_config(id):
     result = Dataset.from_id(id)
     columns = request.json.get("columns")
     label = request.json.get("label")
     model_type = request.json.get("model_type")
     config = DatasetConfig(columns=columns,
                            label=label,
                            model_type=model_type)
     result.configs.append(config)
     app.logger.info(f"Inserting config {request.json}")
     app.logger.info(result.configs)
     result.save()
     return config.to_json(), 201
 def route_get_dataset(id):
     dataset = Dataset.from_id(id)
     return dataset.to_json()
 def delete_dataset(id):
     dataset = Dataset.from_id(id)
     dataset.delete_data()
     dataset.delete()
     return {}
 def get_dataset_visualization(id):
     d = Dataset.from_id(id)
     path = dataset.get_dataset_visualization(Path(d.path), d)
     return send_file(path)
 def lint_config_from_request(id):
     config = request.json
     dataset = Dataset.from_id(id)
     return lint_config(config, dataset)