Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure name and description are set in the exporter mask #4912

Merged
merged 3 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tensorboard/uploader/uploader_subcommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ def execute(self, server_info, channel):
channel
)
fieldmask = experiment_pb2.ExperimentMask(
name=True,
description=True,
create_time=True,
update_time=True,
num_runs=True,
Expand Down
27 changes: 27 additions & 0 deletions tensorboard/uploader/uploader_subcommand_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

import tensorflow as tf

from tensorboard.uploader.proto import experiment_pb2
from tensorboard.uploader.proto import server_info_pb2
from tensorboard.uploader.proto import write_service_pb2
from tensorboard.uploader.proto import write_service_pb2_grpc
from tensorboard.uploader import dry_run_stubs
from tensorboard.uploader import exporter as exporter_lib
from tensorboard.uploader import uploader as uploader_lib
from tensorboard.uploader import uploader_subcommand
from tensorboard.plugins.histogram import metadata as histograms_metadata
Expand Down Expand Up @@ -202,6 +204,31 @@ def testUploadIntentNonDryRunNonOneShotInterrupted(self):
mock_stdout_write.call_args_list[-1][0][0],
)

def testListIntentSetsExperimentMask(self):
mock_server_info = mock.MagicMock()
mock_channel = mock.MagicMock()
expected_mask = experiment_pb2.ExperimentMask(
name=True,
description=True,
create_time=True,
update_time=True,
num_runs=True,
num_tags=True,
num_scalars=True,
total_tensor_bytes=True,
total_blob_bytes=True,
)
with mock.patch.object(
exporter_lib,
"list_experiments",
):
intent = uploader_subcommand._ListIntent()
intent.execute(mock_server_info, mock_channel)
actual_mask = exporter_lib.list_experiments.call_args[1][
"fieldmask"
]
self.assertEquals(actual_mask, expected_mask)


if __name__ == "__main__":
tf.test.main()