Given a single run, return the graph definition in protobuf format.
(self, request)
| 275 | |
| 276 | @wrappers.Request.application |
| 277 | def graph_route(self, request): |
| 278 | """Given a single run, return the graph definition in protobuf |
| 279 | format.""" |
| 280 | ctx = plugin_util.context(request.environ) |
| 281 | experiment = plugin_util.experiment_id(request.environ) |
| 282 | run = request.args.get("run") |
| 283 | tag = request.args.get("tag") |
| 284 | conceptual_arg = request.args.get("conceptual", False) |
| 285 | is_conceptual = True if conceptual_arg == "true" else False |
| 286 | |
| 287 | if run is None: |
| 288 | return http_util.Respond( |
| 289 | request, 'query parameter "run" is required', "text/plain", 400 |
| 290 | ) |
| 291 | |
| 292 | limit_attr_size = request.args.get("limit_attr_size", None) |
| 293 | if limit_attr_size is not None: |
| 294 | try: |
| 295 | limit_attr_size = int(limit_attr_size) |
| 296 | except ValueError: |
| 297 | return http_util.Respond( |
| 298 | request, |
| 299 | "query parameter `limit_attr_size` must be an integer", |
| 300 | "text/plain", |
| 301 | 400, |
| 302 | ) |
| 303 | |
| 304 | large_attrs_key = request.args.get("large_attrs_key", None) |
| 305 | |
| 306 | try: |
| 307 | result = self.graph_impl( |
| 308 | ctx, |
| 309 | run, |
| 310 | tag, |
| 311 | is_conceptual, |
| 312 | experiment, |
| 313 | limit_attr_size, |
| 314 | large_attrs_key, |
| 315 | ) |
| 316 | except ValueError as e: |
| 317 | return http_util.Respond(request, e.message, "text/plain", code=400) |
| 318 | (body, mime_type) = result |
| 319 | return http_util.Respond(request, body, mime_type) |
| 320 | |
| 321 | @wrappers.Request.application |
| 322 | def run_metadata_route(self, request): |
nothing calls this directly
no test coverage detected