File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ export type MetricsOrParams = RelPathObject<FileDataOrError>
6060export const fileHasError = ( file : FileDataOrError ) : file is DvcError =>
6161 ! ! ( file as DvcError ) . error
6262
63+ export const DEFAULT_EXP_SHOW_OUTPUT = [
64+ {
65+ branch : undefined ,
66+ rev : EXPERIMENT_WORKSPACE_ID
67+ }
68+ ]
69+
6370export type ExpData = {
6471 rev : string
6572 timestamp : string | null
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ import {
1010} from './constants'
1111import {
1212 DataStatusOutput ,
13+ DEFAULT_EXP_SHOW_OUTPUT ,
1314 DvcError ,
14- EXPERIMENT_WORKSPACE_ID ,
15+ ExpShowOutput ,
1516 PlotsOutput ,
1617 PlotsOutputOrError ,
17- RawPlotsOutput ,
18- ExpShowOutput
18+ RawPlotsOutput
1919} from './contract'
2020import { getOptions } from './options'
2121import { typeCheckCommands } from '..'
@@ -76,8 +76,7 @@ export class DvcReader extends DvcCli {
7676 if ( isDvcError ( output ) || isEmpty ( output ) ) {
7777 return [
7878 {
79- branch : undefined ,
80- rev : EXPERIMENT_WORKSPACE_ID ,
79+ ...DEFAULT_EXP_SHOW_OUTPUT [ 0 ] ,
8180 ...( output as DvcError )
8281 }
8382 ]
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ import { TEMP_DIR } from './constants'
55import { dvcReader , initializeDemoRepo , initializeEmptyRepo } from './util'
66import { dvcDemoPath } from '../util'
77import {
8- EXPERIMENT_WORKSPACE_ID ,
98 fileHasError ,
10- experimentHasError
9+ experimentHasError ,
10+ DEFAULT_EXP_SHOW_OUTPUT
1111} from '../../cli/dvc/contract'
1212import { ExperimentFlag } from '../../cli/dvc/constants'
1313
@@ -87,11 +87,7 @@ suite('exp show --show-json', () => {
8787 await initializeEmptyRepo ( )
8888 const output = await dvcReader . expShow ( TEMP_DIR )
8989
90- expect ( output ) . to . deep . equal ( [
91- {
92- rev : EXPERIMENT_WORKSPACE_ID
93- }
94- ] )
90+ expect ( output ) . to . deep . equal ( DEFAULT_EXP_SHOW_OUTPUT )
9591 } )
9692 } )
9793} )
You can’t perform that action at this time.
0 commit comments