Skip to content

Commit

Permalink
Fix table stories and data types
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jun 6, 2023
1 parent 34983ba commit 0f02465
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 80 deletions.
3 changes: 0 additions & 3 deletions extension/src/cli/dvc/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const fileHasError = (file: FileDataOrError): file is DvcError =>

export const DEFAULT_EXP_SHOW_OUTPUT = [
{
branch: undefined,
rev: EXPERIMENT_WORKSPACE_ID
}
]
Expand Down Expand Up @@ -97,13 +96,11 @@ export type ExecutorState = {
export type ExpWithError = {
rev: string
name?: string
branch: string | undefined
} & DvcError

type ExpWithData = {
rev: string
name?: string
branch: string | undefined
data: ExpData
}

Expand Down
5 changes: 1 addition & 4 deletions extension/src/cli/dvc/reader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ describe('CliReader', () => {
const cliOutput = await dvcReader.expShow(cwd)
expect(cliOutput).toStrictEqual([
{
branch: undefined,
error: { msg: unexpectedStderr, type: 'Caught error' },
rev: EXPERIMENT_WORKSPACE_ID
}
Expand All @@ -111,9 +110,7 @@ describe('CliReader', () => {
)

const cliOutput = await dvcReader.expShow(cwd)
expect(cliOutput).toStrictEqual([
{ branch: undefined, rev: EXPERIMENT_WORKSPACE_ID }
])
expect(cliOutput).toStrictEqual([{ rev: EXPERIMENT_WORKSPACE_ID }])
})
})

Expand Down
1 change: 0 additions & 1 deletion extension/src/experiments/columns/collect/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ describe('collectRelativeMetricsFiles', () => {
expect(
collectRelativeMetricsFiles([
{
branch: 'main',
rev: EXPERIMENT_WORKSPACE_ID,
error: { msg: 'I broke', type: 'not important' }
}
Expand Down
4 changes: 1 addition & 3 deletions extension/src/experiments/model/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const collectExpState = (
expState: ExpState,
commitData: { [sha: string]: CommitData }
): Experiment | undefined => {
const { rev, name, branch } = expState
const { rev, name } = expState
const label =
rev === EXPERIMENT_WORKSPACE_ID
? EXPERIMENT_WORKSPACE_ID
Expand All @@ -168,7 +168,6 @@ const collectExpState = (
const description: string | undefined = formatCommitMessage(commit?.message)

const experiment: Experiment = {
branch,
commit,
description,
id,
Expand Down Expand Up @@ -342,7 +341,6 @@ export const collectExperiments = (
hasCheckpoints: hasCheckpoints(expShow),
runningExperiments: [],
workspace: {
branch: undefined,
id: EXPERIMENT_WORKSPACE_ID,
label: EXPERIMENT_WORKSPACE_ID
}
Expand Down
2 changes: 1 addition & 1 deletion extension/src/experiments/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export class ExperimentsModel extends ModelWithPersistence {
}

return [
this.addDetails(this.workspace),
{ branch: undefined, ...this.addDetails(this.workspace) },
...this.rowOrder.map(({ branch, sha }) => {
const commit = { ...commitsBySha[sha], branch }
const experiments = this.getExperimentsByCommit(commit)
Expand Down
2 changes: 1 addition & 1 deletion extension/src/experiments/webview/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type Experiment = {
starred?: boolean
status?: ExperimentStatus
timestamp?: string | null
branch?: string
branch?: string | undefined
}

export const isRunning = (status: ExperimentStatus | undefined): boolean =>
Expand Down
11 changes: 0 additions & 11 deletions extension/src/test/fixtures/expShow/base/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const ERROR_SHAS = [

const data: ExpShowOutput = [
{
branch: 'main',
rev: EXPERIMENT_WORKSPACE_ID,
data: {
rev: EXPERIMENT_WORKSPACE_ID,
Expand Down Expand Up @@ -123,7 +122,6 @@ const data: ExpShowOutput = [
}
},
{
branch: 'main',
rev: '53c3851f46955fa3e2b8f6e1c52999acc8c9ea77',
name: 'main',
data: {
Expand Down Expand Up @@ -236,7 +234,6 @@ const data: ExpShowOutput = [
name: 'exp-e7a67',
revs: [
{
branch: 'main',
rev: '4fb124aebddb2adf1545030907687fa9a4c80e70',
name: 'exp-e7a67',
data: {
Expand Down Expand Up @@ -356,7 +353,6 @@ const data: ExpShowOutput = [
name: 'test-branch',
revs: [
{
branch: 'main',
rev: '42b8736b08170529903cd203a1f40382a4b4a8cd',
name: 'test-branch',
data: {
Expand Down Expand Up @@ -472,7 +468,6 @@ const data: ExpShowOutput = [
name: 'exp-83425',
revs: [
{
branch: 'main',
rev: EXPERIMENT_WORKSPACE_ID,
name: 'exp-83425',
data: {
Expand Down Expand Up @@ -591,7 +586,6 @@ const data: ExpShowOutput = [
{
revs: [
{
branch: 'main',
rev: ERROR_SHAS[0],
error: {
type: 'YAMLFileCorruptedError',
Expand All @@ -605,7 +599,6 @@ const data: ExpShowOutput = [
name: 'exp-f13bca',
revs: [
{
branch: 'main',
rev: ERROR_SHAS[1],
name: 'exp-f13bca',
data: {
Expand Down Expand Up @@ -718,7 +711,6 @@ const data: ExpShowOutput = [
{
revs: [
{
branch: 'main',
rev: '90aea7f2482117a55dfcadcdb901aaa6610fbbc9',
data: {
rev: '90aea7f2482117a55dfcadcdb901aaa6610fbbc9',
Expand Down Expand Up @@ -833,7 +825,6 @@ const data: ExpShowOutput = [
{
revs: [
{
branch: 'main',
rev: ERROR_SHAS[2],
data: {
rev: ERROR_SHAS[2],
Expand Down Expand Up @@ -916,7 +907,6 @@ const data: ExpShowOutput = [
]
},
{
branch: 'main',
rev: 'fe2919bb4394b30494bea905c253e10077b9a1bd',
data: {
rev: 'fe2919bb4394b30494bea905c253e10077b9a1bd',
Expand Down Expand Up @@ -1025,7 +1015,6 @@ const data: ExpShowOutput = [
}
},
{
branch: 'main',
rev: '7df876cb5147800cd3e489d563bc6dcd67188621',
data: {
rev: '7df876cb5147800cd3e489d563bc6dcd67188621',
Expand Down
2 changes: 1 addition & 1 deletion extension/src/test/fixtures/expShow/base/rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const colorsList = copyOriginalColors()

const rowsFixture: Commit[] = [
{
branch: 'main',
branch: undefined,
commit: undefined,
description: undefined,
deps: {
Expand Down
2 changes: 0 additions & 2 deletions extension/src/test/fixtures/expShow/dataTypes/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {

const data: ExpShowOutput = [
{
branch: 'main',
data: {
deps: null,
meta: { has_checkpoints: false },
Expand All @@ -31,7 +30,6 @@ const data: ExpShowOutput = [
rev: EXPERIMENT_WORKSPACE_ID
},
{
branch: 'main',
data: {
deps: null,
meta: { has_checkpoints: false },
Expand Down
2 changes: 1 addition & 1 deletion extension/src/test/fixtures/expShow/dataTypes/rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Commit } from '../../../../experiments/webview/contract'

const data: Commit[] = [
{
branch: 'main',
branch: undefined,
displayColor: undefined,
id: EXPERIMENT_WORKSPACE_ID,
label: EXPERIMENT_WORKSPACE_ID,
Expand Down
2 changes: 0 additions & 2 deletions extension/src/test/fixtures/expShow/deeplyNested/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {

const data: ExpShowOutput = [
{
branch: 'main',
rev: EXPERIMENT_WORKSPACE_ID,
data: {
deps: null,
Expand Down Expand Up @@ -38,7 +37,6 @@ const data: ExpShowOutput = [
}
},
{
branch: 'main',
rev: '53c3851f46955fa3e2b8f6e1c52999acc8c9ea77',
data: {
deps: null,
Expand Down
2 changes: 1 addition & 1 deletion extension/src/test/fixtures/expShow/deeplyNested/rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EXPERIMENT_WORKSPACE_ID } from '../../../../cli/dvc/contract'

export const data = [
{
branch: 'main',
branch: undefined,
id: EXPERIMENT_WORKSPACE_ID,
label: EXPERIMENT_WORKSPACE_ID,
params: {
Expand Down
4 changes: 0 additions & 4 deletions extension/src/test/fixtures/expShow/survival/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { join } from '../../../util/path'
// https://dagshub.com/kingabzpro/kaggle-titanic-dvc
const data: ExpShowOutput = [
{
branch: 'main',
rev: EXPERIMENT_WORKSPACE_ID,
data: {
rev: EXPERIMENT_WORKSPACE_ID,
Expand Down Expand Up @@ -312,7 +311,6 @@ const data: ExpShowOutput = [
}
},
{
branch: 'main',
rev: '3d5adcb974bb2c85917a5d61a489b933adaa2b7f',
data: {
meta: { has_checkpoints: false },
Expand Down Expand Up @@ -618,7 +616,6 @@ const data: ExpShowOutput = [
name: 'main'
},
{
branch: 'main',
rev: 'a49e03966a1f9f1299ec222ebc4bed8625d2c54d',
data: {
rev: 'a49e03966a1f9f1299ec222ebc4bed8625d2c54d',
Expand Down Expand Up @@ -923,7 +920,6 @@ const data: ExpShowOutput = [
}
},
{
branch: 'main',
rev: '4f7b50c3d171a11b6cfcd04416a16fc80b61018d',
data: {
rev: '4f7b50c3d171a11b6cfcd04416a16fc80b61018d',
Expand Down
2 changes: 1 addition & 1 deletion extension/src/test/fixtures/expShow/survival/rows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EXPERIMENT_WORKSPACE_ID } from '../../../../cli/dvc/contract'

const data: Commit[] = [
{
branch: 'main',
branch: undefined,
id: EXPERIMENT_WORKSPACE_ID,
label: EXPERIMENT_WORKSPACE_ID,
metrics: {
Expand Down
2 changes: 0 additions & 2 deletions extension/src/test/fixtures/expShow/uncommittedDeps/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {

const data: ExpShowOutput = [
{
branch: 'main',
rev: EXPERIMENT_WORKSPACE_ID,
data: {
meta: { has_checkpoints: false },
Expand Down Expand Up @@ -64,7 +63,6 @@ const data: ExpShowOutput = [
}
},
{
branch: 'main',
rev: '852d4fbd10638ceca4de50ee68d6125b2915f23b',
data: {
deps: null,
Expand Down
1 change: 0 additions & 1 deletion extension/src/test/util/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const generateTestExpState = (
data: Partial<ExpData> = {},
name?: string
): ExpState => ({
branch: 'main',
data: generateTestExpData({ ...data, rev }),
name,
rev
Expand Down
Loading

0 comments on commit 0f02465

Please sign in to comment.