Skip to content

Commit

Permalink
Collect columns from experiments under baseline with error (#5041)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Nov 29, 2023
1 parent f029c77 commit 37e8668
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extension/src/cli/dvc/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export type ExpData = {
metrics: MetricsOrParams | null
deps: Deps | null
outs: Outs | null
meta: { has_checkpoints: boolean }
meta: { has_checkpoints?: boolean }
}

export enum Executor {
Expand Down
85 changes: 85 additions & 0 deletions extension/src/experiments/columns/collect/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,91 @@ describe('collectColumns', () => {
)
])
})

it('should collect columns from experiments with a broken baseline', async () => {
const missingParamsYaml = [
{
error: {
msg: "failed to parse 'stages.main.cmd' in 'dvc.yaml': Could not find 'parameters.parameter_name'",
type: 'ResolveError'
},
experiments: null,
rev: 'workspace'
},
{
error: {
msg: "failed to parse 'stages.main.cmd' in 'dvc.yaml': Could not find 'parameters.parameter_name'",
type: 'ResolveError'
},
experiments: [
{
executor: null,
name: 'exp1',
revs: [
{
data: {
deps: {},
meta: {},
params: {
'dvclive/params.yaml': {
data: {
result: 0.6936822634315442
}
},
'params.yaml': {
data: {
parameters: {
parameter_name: 'parameter_value'
}
}
}
},
metrics: {},
rev: 'ee23879da223ff9d5bd906bdd8969cc0ea90344f',
outs: {},
timestamp: '2023-11-28T16:07:17'
},
experiments: null,
name: 'exp1',
rev: 'ee23879da223ff9d5bd906bdd8969cc0ea90344f'
}
]
}
],
name: 'master',
rev: '616500724541bcd2f7f89584187b00f838ecf9a9'
},
{
data: {
deps: {},
meta: {},
metrics: {},
outs: {},
params: {},
rev: '7d527bc6ae94befdc9352e59d80b133cdb0a1e7a',
timestamp: '2023-11-28T15:57:50'
},
experiments: null,
rev: '7d527bc6ae94befdc9352e59d80b133cdb0a1e7a'
},
{
data: {
deps: {},
meta: {},
metrics: {},
outs: {},
params: {},
rev: '19825884a7acacc3177716c8fd7b2502ed129c59',
timestamp: '2023-11-28T13:09:17'
},
experiments: null,
rev: '19825884a7acacc3177716c8fd7b2502ed129c59'
}
]

const columns = await collectColumns(missingParamsYaml)
expect(columns).toHaveLength(6)
})
})

describe('collectChanges', () => {
Expand Down
9 changes: 3 additions & 6 deletions extension/src/experiments/columns/collect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ export const collectColumns = async (

const promises = []
for (const expState of output) {
if (experimentHasError(expState)) {
continue
if (!experimentHasError(expState)) {
promises.push(collectFromExperiment(acc, expState))
}

promises.push(
collectFromExperiment(acc, expState),
collectFromExperiments(acc, expState.experiments)
)
promises.push(collectFromExperiments(acc, expState.experiments))
}
await Promise.all(promises)

Expand Down

0 comments on commit 37e8668

Please sign in to comment.