From 28be621b99e1bb2595b39d915055c32ca986a805 Mon Sep 17 00:00:00 2001 From: louis49 Date: Wed, 17 Jan 2024 18:09:20 +0100 Subject: [PATCH] Fixing 6088 : Download CSV data (#6719) ## Motivation for features / changes Fixing 6088 : Download CSV data ## Technical description of changes Setting good parameters to constructor and adding a default value for an optional parameter ## Detailed steps to verify changes work correctly (as executed by you) Download with no error Googlers, see b/307370637. @yatbear tested internally at cl/598969320. --- tensorboard/plugins/hparams/get_experiment.py | 10 ++++++++-- tensorboard/plugins/hparams/hparams_plugin.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tensorboard/plugins/hparams/get_experiment.py b/tensorboard/plugins/hparams/get_experiment.py index e249b23599..3ebd8b2ae5 100644 --- a/tensorboard/plugins/hparams/get_experiment.py +++ b/tensorboard/plugins/hparams/get_experiment.py @@ -14,6 +14,8 @@ # ============================================================================== """Classes and functions for handling the GetExperiment API call.""" +from tensorboard.plugins.hparams import api_pb2 + class Handler: """Handles a GetExperiment request.""" @@ -27,7 +29,7 @@ def __init__( request_context: A tensorboard.context.RequestContext. backend_context: A backend_context.Context instance. experiment_id: A string, as from `plugin_util.experiment_id`. - request: A api_pb2.GetExperimentRequest instance. + request: A request proto. """ self._request_context = request_context self._backend_context = backend_context @@ -38,7 +40,11 @@ def __init__( not request.HasField("include_metrics") or request.include_metrics ) - self._hparams_limit = request.hparams_limit + self._hparams_limit = ( + request.hparams_limit + if isinstance(request, api_pb2.GetExperimentRequest) + else None + ) def run(self): """Handles the request specified on construction. diff --git a/tensorboard/plugins/hparams/hparams_plugin.py b/tensorboard/plugins/hparams/hparams_plugin.py index ffb111594f..d11e048099 100644 --- a/tensorboard/plugins/hparams/hparams_plugin.py +++ b/tensorboard/plugins/hparams/hparams_plugin.py @@ -93,7 +93,7 @@ def download_data_route(self, request): ctx, self._context, experiment_id, request_proto ).run() experiment = get_experiment.Handler( - ctx, self._context, experiment_id + ctx, self._context, experiment_id, request_proto ).run() body, mime_type = download_data.Handler( self._context,