Skip to content

Commit

Permalink
Allow system_attr.constraints to be undef in JournalOpSetTrialSystemA…
Browse files Browse the repository at this point in the history
…ttr interface
  • Loading branch information
porink0424 committed May 10, 2024
1 parent 2a41914 commit 0ceaec0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tslib/storage/src/journal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface JournalOpDeleteStudy extends JournalOpBase {
interface JournalOpSetStudySystemAttr extends JournalOpBase {
study_id: number
system_attr: {
"study:metric_names": string[]
"study:metric_names"?: string[]
}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ interface JournalOpSetTrialUserAttr extends JournalOpBase {
interface JournalOpSetTrialSystemAttr extends JournalOpBase {
trial_id: number
system_attr: {
constraints: number[]
constraints?: number[]
}
}

Expand Down Expand Up @@ -355,7 +355,9 @@ class JournalStorage {
if (thisStudy === undefined || thisTrial === undefined) {
return
}
thisTrial.constraints = log.system_attr.constraints
if (log.system_attr.constraints) {
thisTrial.constraints = log.system_attr.constraints
}
}
}

Expand Down

0 comments on commit 0ceaec0

Please sign in to comment.