Skip to content

Commit 29dff2f

Browse files
authored
Handle null hparam values in table view. (#6516)
Hparams from data provider can return null for some hparam values. The Hparams dashboard code does not yet expect this and would call toString() on null values, resulting in error and stopping the table from rendering properly. The fix is simple, render empty string '' for null values just as we already do for undefined values.
1 parent 73d72db commit 29dff2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorboard/plugins/hparams/tf_hparams_utils/tf-hparams-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export function prettyPrint(value) {
302302
// TODO(erez):Make the precision user-configurable.
303303
return value.toPrecision(5);
304304
}
305-
if (value === undefined) {
305+
if (value === null || value === undefined) {
306306
return '';
307307
}
308308
return value.toString();

0 commit comments

Comments
 (0)