Skip to content

Commit 69c26db

Browse files
authored
Fix table stories and data types (#4041)
1 parent 34983ba commit 69c26db

File tree

18 files changed

+23
-80
lines changed

18 files changed

+23
-80
lines changed

extension/src/cli/dvc/contract.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export const fileHasError = (file: FileDataOrError): file is DvcError =>
6262

6363
export const DEFAULT_EXP_SHOW_OUTPUT = [
6464
{
65-
branch: undefined,
6665
rev: EXPERIMENT_WORKSPACE_ID
6766
}
6867
]
@@ -97,13 +96,11 @@ export type ExecutorState = {
9796
export type ExpWithError = {
9897
rev: string
9998
name?: string
100-
branch: string | undefined
10199
} & DvcError
102100

103101
type ExpWithData = {
104102
rev: string
105103
name?: string
106-
branch: string | undefined
107104
data: ExpData
108105
}
109106

extension/src/cli/dvc/reader.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ describe('CliReader', () => {
9797
const cliOutput = await dvcReader.expShow(cwd)
9898
expect(cliOutput).toStrictEqual([
9999
{
100-
branch: undefined,
101100
error: { msg: unexpectedStderr, type: 'Caught error' },
102101
rev: EXPERIMENT_WORKSPACE_ID
103102
}
@@ -111,9 +110,7 @@ describe('CliReader', () => {
111110
)
112111

113112
const cliOutput = await dvcReader.expShow(cwd)
114-
expect(cliOutput).toStrictEqual([
115-
{ branch: undefined, rev: EXPERIMENT_WORKSPACE_ID }
116-
])
113+
expect(cliOutput).toStrictEqual([{ rev: EXPERIMENT_WORKSPACE_ID }])
117114
})
118115
})
119116

extension/src/experiments/columns/collect/index.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ describe('collectRelativeMetricsFiles', () => {
733733
expect(
734734
collectRelativeMetricsFiles([
735735
{
736-
branch: 'main',
737736
rev: EXPERIMENT_WORKSPACE_ID,
738737
error: { msg: 'I broke', type: 'not important' }
739738
}

extension/src/experiments/model/collect.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const collectExpState = (
157157
expState: ExpState,
158158
commitData: { [sha: string]: CommitData }
159159
): Experiment | undefined => {
160-
const { rev, name, branch } = expState
160+
const { rev, name } = expState
161161
const label =
162162
rev === EXPERIMENT_WORKSPACE_ID
163163
? EXPERIMENT_WORKSPACE_ID
@@ -168,7 +168,6 @@ const collectExpState = (
168168
const description: string | undefined = formatCommitMessage(commit?.message)
169169

170170
const experiment: Experiment = {
171-
branch,
172171
commit,
173172
description,
174173
id,
@@ -342,7 +341,6 @@ export const collectExperiments = (
342341
hasCheckpoints: hasCheckpoints(expShow),
343342
runningExperiments: [],
344343
workspace: {
345-
branch: undefined,
346344
id: EXPERIMENT_WORKSPACE_ID,
347345
label: EXPERIMENT_WORKSPACE_ID
348346
}

extension/src/experiments/model/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ export class ExperimentsModel extends ModelWithPersistence {
374374
}
375375

376376
return [
377-
this.addDetails(this.workspace),
377+
{ branch: undefined, ...this.addDetails(this.workspace) },
378378
...this.rowOrder.map(({ branch, sha }) => {
379379
const commit = { ...commitsBySha[sha], branch }
380380
const experiments = this.getExperimentsByCommit(commit)

extension/src/experiments/webview/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export type Experiment = {
4646
starred?: boolean
4747
status?: ExperimentStatus
4848
timestamp?: string | null
49-
branch?: string
49+
branch?: string | undefined
5050
}
5151

5252
export const isRunning = (status: ExperimentStatus | undefined): boolean =>

extension/src/test/fixtures/expShow/base/output.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const ERROR_SHAS = [
1414

1515
const data: ExpShowOutput = [
1616
{
17-
branch: 'main',
1817
rev: EXPERIMENT_WORKSPACE_ID,
1918
data: {
2019
rev: EXPERIMENT_WORKSPACE_ID,
@@ -123,7 +122,6 @@ const data: ExpShowOutput = [
123122
}
124123
},
125124
{
126-
branch: 'main',
127125
rev: '53c3851f46955fa3e2b8f6e1c52999acc8c9ea77',
128126
name: 'main',
129127
data: {
@@ -236,7 +234,6 @@ const data: ExpShowOutput = [
236234
name: 'exp-e7a67',
237235
revs: [
238236
{
239-
branch: 'main',
240237
rev: '4fb124aebddb2adf1545030907687fa9a4c80e70',
241238
name: 'exp-e7a67',
242239
data: {
@@ -356,7 +353,6 @@ const data: ExpShowOutput = [
356353
name: 'test-branch',
357354
revs: [
358355
{
359-
branch: 'main',
360356
rev: '42b8736b08170529903cd203a1f40382a4b4a8cd',
361357
name: 'test-branch',
362358
data: {
@@ -472,7 +468,6 @@ const data: ExpShowOutput = [
472468
name: 'exp-83425',
473469
revs: [
474470
{
475-
branch: 'main',
476471
rev: EXPERIMENT_WORKSPACE_ID,
477472
name: 'exp-83425',
478473
data: {
@@ -591,7 +586,6 @@ const data: ExpShowOutput = [
591586
{
592587
revs: [
593588
{
594-
branch: 'main',
595589
rev: ERROR_SHAS[0],
596590
error: {
597591
type: 'YAMLFileCorruptedError',
@@ -605,7 +599,6 @@ const data: ExpShowOutput = [
605599
name: 'exp-f13bca',
606600
revs: [
607601
{
608-
branch: 'main',
609602
rev: ERROR_SHAS[1],
610603
name: 'exp-f13bca',
611604
data: {
@@ -718,7 +711,6 @@ const data: ExpShowOutput = [
718711
{
719712
revs: [
720713
{
721-
branch: 'main',
722714
rev: '90aea7f2482117a55dfcadcdb901aaa6610fbbc9',
723715
data: {
724716
rev: '90aea7f2482117a55dfcadcdb901aaa6610fbbc9',
@@ -833,7 +825,6 @@ const data: ExpShowOutput = [
833825
{
834826
revs: [
835827
{
836-
branch: 'main',
837828
rev: ERROR_SHAS[2],
838829
data: {
839830
rev: ERROR_SHAS[2],
@@ -916,7 +907,6 @@ const data: ExpShowOutput = [
916907
]
917908
},
918909
{
919-
branch: 'main',
920910
rev: 'fe2919bb4394b30494bea905c253e10077b9a1bd',
921911
data: {
922912
rev: 'fe2919bb4394b30494bea905c253e10077b9a1bd',
@@ -1025,7 +1015,6 @@ const data: ExpShowOutput = [
10251015
}
10261016
},
10271017
{
1028-
branch: 'main',
10291018
rev: '7df876cb5147800cd3e489d563bc6dcd67188621',
10301019
data: {
10311020
rev: '7df876cb5147800cd3e489d563bc6dcd67188621',

extension/src/test/fixtures/expShow/base/rows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const colorsList = copyOriginalColors()
1717

1818
const rowsFixture: Commit[] = [
1919
{
20-
branch: 'main',
20+
branch: undefined,
2121
commit: undefined,
2222
description: undefined,
2323
deps: {

extension/src/test/fixtures/expShow/dataTypes/output.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55

66
const data: ExpShowOutput = [
77
{
8-
branch: 'main',
98
data: {
109
deps: null,
1110
meta: { has_checkpoints: false },
@@ -31,7 +30,6 @@ const data: ExpShowOutput = [
3130
rev: EXPERIMENT_WORKSPACE_ID
3231
},
3332
{
34-
branch: 'main',
3533
data: {
3634
deps: null,
3735
meta: { has_checkpoints: false },

extension/src/test/fixtures/expShow/dataTypes/rows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Commit } from '../../../../experiments/webview/contract'
33

44
const data: Commit[] = [
55
{
6-
branch: 'main',
6+
branch: undefined,
77
displayColor: undefined,
88
id: EXPERIMENT_WORKSPACE_ID,
99
label: EXPERIMENT_WORKSPACE_ID,

0 commit comments

Comments
 (0)