Skip to content

Commit 933f37a

Browse files
authored
Fixes sync errors (#6739)
## Motivation for features / changes Recently merged hparam column PRs (#6732, #6733, #6736) will cause build and lint errors during 1p sync. ## Technical description of changes - import map from rxjs/operators instead of rxjs - `DataTableUtils` -> `dataTableUtils` - use proper string signature on CardStateMap in tests
1 parent 65e6eb3 commit 933f37a

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

tensorboard/webapp/hparams/_redux/hparams_reducers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
1515
import {Action, ActionReducer, createReducer, on} from '@ngrx/store';
16-
import {DataTableUtils} from '../../widgets/data_table/utils';
16+
import {dataTableUtils} from '../../widgets/data_table/utils';
1717
import {persistentSettingsLoaded} from '../../persistent_settings';
1818
import {Side} from '../../widgets/data_table/types';
1919
import * as actions from './hparams_actions';
@@ -153,7 +153,7 @@ const reducer: ActionReducer<HparamsState, Action> = createReducer(
153153
actions.dashboardHparamColumnOrderChanged,
154154
(state, {source, destination, side}) => {
155155
const {dashboardDisplayedHparamColumns: columns} = state;
156-
const newColumns = DataTableUtils.moveColumn(
156+
const newColumns = dataTableUtils.moveColumn(
157157
columns,
158158
source,
159159
destination,

tensorboard/webapp/hparams/_redux/hparams_reducers_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import * as actions from './hparams_actions';
1818
import {reducers} from './hparams_reducers';
1919
import {buildHparamSpec, buildHparamsState, buildMetricSpec} from './testing';
2020
import {ColumnHeaderType, Side} from '../../widgets/data_table/types';
21-
import {DataTableUtils} from '../../widgets/data_table/utils';
2221
import {persistentSettingsLoaded} from '../../persistent_settings';
22+
import {dataTableUtils} from '../../widgets/data_table/utils';
2323

2424
describe('hparams/_redux/hparams_reducers_test', () => {
2525
describe('#persistentSettingsLoaded', () => {
@@ -673,7 +673,7 @@ describe('hparams/_redux/hparams_reducers_test', () => {
673673
dashboardDisplayedHparamColumns: fakeColumns,
674674
});
675675
const moveColumnSpy = spyOn(
676-
DataTableUtils,
676+
dataTableUtils,
677677
'moveColumn'
678678
).and.callThrough();
679679

tensorboard/webapp/metrics/store/metrics_reducers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ import {
7878
TimeSeriesData,
7979
TimeSeriesLoadable,
8080
} from './metrics_types';
81-
import {DataTableUtils} from '../../widgets/data_table/utils';
81+
import {dataTableUtils} from '../../widgets/data_table/utils';
8282

8383
function buildCardMetadataList(tagMetadata: TagMetadata): CardMetadata[] {
8484
const results: CardMetadata[] = [];
@@ -1438,7 +1438,7 @@ const reducer = createReducer(
14381438
dataTableMode === DataTableMode.RANGE
14391439
? [...state.rangeSelectionHeaders]
14401440
: [...state.singleSelectionHeaders];
1441-
headers = DataTableUtils.moveColumn(headers, source, destination, side);
1441+
headers = dataTableUtils.moveColumn(headers, source, destination, side);
14421442

14431443
if (dataTableMode === DataTableMode.RANGE) {
14441444
return {

tensorboard/webapp/metrics/store/metrics_selectors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import {ColumnHeader, DataTableMode} from '../../widgets/data_table/types';
5151
import {Extent} from '../../widgets/line_chart_v2/lib/public_types';
5252
import {memoize} from '../../util/memoize';
5353
import {getDashboardDisplayedHparamColumns} from '../../hparams/_redux/hparams_selectors';
54-
import {DataTableUtils} from '../../widgets/data_table/utils';
54+
import {dataTableUtils} from '../../widgets/data_table/utils';
5555

5656
const selectMetricsState =
5757
createFeatureSelector<MetricsState>(METRICS_FEATURE_KEY);
@@ -669,6 +669,6 @@ export const getGroupedHeadersForCard = memoize((cardId: string) =>
669669
getColumnHeadersForCard(cardId),
670670
getDashboardDisplayedHparamColumns,
671671
(standardColumns, hparamColumns) =>
672-
DataTableUtils.groupColumns([...standardColumns, ...hparamColumns])
672+
dataTableUtils.groupColumns([...standardColumns, ...hparamColumns])
673673
)
674674
);

tensorboard/webapp/metrics/views/right_pane/scalar_column_editor/scalar_column_editor_container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
ColumnHeader,
3232
DataTableMode,
3333
} from '../../../../widgets/data_table/types';
34-
import {map} from 'rxjs';
34+
import {map} from 'rxjs/operators';
3535

3636
function headersWithoutRuns(headers: ColumnHeader[]) {
3737
return headers.filter((header) => header.type !== 'RUN');

tensorboard/webapp/runs/store/runs_selectors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
} from '../../hparams/_redux/hparams_selectors';
3333
import {HparamValue, RunToHparamsAndMetrics} from '../../hparams/types';
3434
import {ColumnHeader, SortingInfo} from '../../widgets/data_table/types';
35-
import {DataTableUtils} from '../../widgets/data_table/utils';
35+
import {dataTableUtils} from '../../widgets/data_table/utils';
3636

3737
const getRunsState = createFeatureSelector<RunsState>(RUNS_FEATURE_KEY);
3838

@@ -340,6 +340,6 @@ export const getGroupedRunsTableHeaders = createSelector(
340340
}
341341
return newColumn;
342342
});
343-
return DataTableUtils.groupColumns(columns);
343+
return dataTableUtils.groupColumns(columns);
344344
}
345345
);

tensorboard/webapp/widgets/data_table/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function groupColumns(columns: ColumnHeader[]): ColumnHeader[] {
8080
return Array.from(headerGroups.values()).flat();
8181
}
8282

83-
export const DataTableUtils = {
83+
export const dataTableUtils = {
8484
moveColumn,
8585
groupColumns,
8686
};

tensorboard/webapp/widgets/data_table/utils_test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ limitations under the License.
1414
==============================================================================*/
1515

1616
import {ColumnHeaderType, Side} from './types';
17-
import {DataTableUtils} from './utils';
17+
import {dataTableUtils} from './utils';
1818

1919
describe('data table utils', () => {
2020
describe('groupColumns', () => {
@@ -58,7 +58,7 @@ describe('data table utils', () => {
5858
},
5959
];
6060

61-
expect(DataTableUtils.groupColumns(inputColumns)).toEqual([
61+
expect(dataTableUtils.groupColumns(inputColumns)).toEqual([
6262
{
6363
type: ColumnHeaderType.RUN,
6464
name: 'run',
@@ -128,7 +128,7 @@ describe('data table utils', () => {
128128
];
129129

130130
it('returns original headers if source is not found', () => {
131-
const moveResult = DataTableUtils.moveColumn(
131+
const moveResult = dataTableUtils.moveColumn(
132132
fakeColumns,
133133
{
134134
type: ColumnHeaderType.HPARAM,
@@ -149,7 +149,7 @@ describe('data table utils', () => {
149149
});
150150

151151
it('returns original headers if source equals dest', () => {
152-
const moveResult = DataTableUtils.moveColumn(
152+
const moveResult = dataTableUtils.moveColumn(
153153
fakeColumns,
154154
{
155155
type: ColumnHeaderType.HPARAM,
@@ -190,7 +190,7 @@ describe('data table utils', () => {
190190
},
191191
].forEach(({testDesc, side, expectedResult}) => {
192192
it(`if destination not found, moves source ${testDesc}`, () => {
193-
const moveResult = DataTableUtils.moveColumn(
193+
const moveResult = dataTableUtils.moveColumn(
194194
fakeColumns,
195195
fakeColumns[1],
196196
{
@@ -207,7 +207,7 @@ describe('data table utils', () => {
207207
});
208208

209209
it('swaps source and destination positions if destination is found', () => {
210-
const moveResult = DataTableUtils.moveColumn(
210+
const moveResult = dataTableUtils.moveColumn(
211211
fakeColumns,
212212
fakeColumns[1],
213213
fakeColumns[0],

0 commit comments

Comments
 (0)