From 8fe233649b930b9cd6d87569831569dc6357cfc1 Mon Sep 17 00:00:00 2001 From: Adrian RC Date: Tue, 8 Apr 2025 00:26:18 +0000 Subject: [PATCH] This replicates an internal LSC from cl/744890759, so we would not override those changes when syncing our repo into the internal code base. (This also replicates several changes from the formatter.) --- tensorboard/plugins/graph/tf_graph_info/tf-node-info.ts | 8 ++++++++ .../hparams/tf_hparams_parallel_coords_plot/axes.ts | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tensorboard/plugins/graph/tf_graph_info/tf-node-info.ts b/tensorboard/plugins/graph/tf_graph_info/tf-node-info.ts index 2504b9a8f79..0af4ad6cc8b 100644 --- a/tensorboard/plugins/graph/tf_graph_info/tf-node-info.ts +++ b/tensorboard/plugins/graph/tf_graph_info/tf-node-info.ts @@ -567,6 +567,10 @@ class TfNodeInfo extends LegacyElementMixin(PolymerElement) { @computed('_node') get _device(): string { var node = this._node; + // TODO: go/ts58upgrade - Fix type mismatch caused by improved checking of + // returned conditional operators after upgrade + // TS2322: Type 'null' is not assignable to type 'string'. + // @ts-ignore return node ? node.device : null; } @computed('_node', 'graphHierarchy') @@ -675,6 +679,10 @@ class TfNodeInfo extends LegacyElementMixin(PolymerElement) { @computed('_node') get _subnodes(): unknown[] { var node = this._node; + // TODO: go/ts58upgrade - Fix type mismatch caused by improved checking of + // returned conditional operators after upgrade + // TS2322: Type 'null' is not assignable to type 'unknown[]'. + // @ts-ignore return node && node.metagraph ? node.metagraph.nodes() : null; } @computed('_predecessors') diff --git a/tensorboard/plugins/hparams/tf_hparams_parallel_coords_plot/axes.ts b/tensorboard/plugins/hparams/tf_hparams_parallel_coords_plot/axes.ts index c54d2ded2c8..254b8e3bbb0 100644 --- a/tensorboard/plugins/hparams/tf_hparams_parallel_coords_plot/axes.ts +++ b/tensorboard/plugins/hparams/tf_hparams_parallel_coords_plot/axes.ts @@ -509,7 +509,11 @@ export class AxesCollection { public getAxisPosition(colIndex: number): number { return this._draggedAxis !== null && this._draggedAxis.colIndex() === colIndex - ? this._draggedAxisPosition + ? // TODO: go/ts58upgrade - Fix type mismatch caused by improved checking + // of returned conditional operators after upgrade + // TS2322: Type 'number | null' is not assignable to type 'number'. + // @ts-ignore + this._draggedAxisPosition : this._stationaryAxesPositions(colIndex); } /**