Skip to content

Commit

Permalink
Fixing 6088 : Download CSV data (tensorflow#6719)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
louis49 authored Jan 17, 2024
1 parent d1ab6e7 commit 28be621
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions tensorboard/plugins/hparams/get_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tensorboard/plugins/hparams/hparams_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 28be621

Please sign in to comment.