Skip to content

Commit 0cb5cba

Browse files
authored
DATA-4500 Update CLI + Go SDK (#5222)
1 parent 7fe5959 commit 0cb5cba

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

app/data_client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ type DataPipelineRun struct {
436436
DataEndTime time.Time
437437
// Status is the run's current status.
438438
Status DataPipelineRunStatus
439+
// ErrorMessage is the error message of the data pipeline run. It is only set if the run failed.
440+
ErrorMessage string
439441
}
440442

441443
// ListDataPipelineRunsPage is a results page of data pipeline runs, used for pagination.
@@ -1916,6 +1918,7 @@ func dataPipelineRunFromProto(proto *datapipelinesPb.DataPipelineRun) *DataPipel
19161918
DataStartTime: proto.DataStartTime.AsTime(),
19171919
DataEndTime: proto.DataEndTime.AsTime(),
19181920
Status: dataPipelineRunStatusFromProto(proto.Status),
1921+
ErrorMessage: proto.ErrorMessage,
19191922
}
19201923
}
19211924

app/data_client_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ var (
187187
DataStartTime: timestamppb.New(time.Date(2023, 1, 1, 11, 0, 0, 0, time.UTC)),
188188
DataEndTime: timestamppb.New(time.Date(2023, 1, 1, 12, 30, 0, 0, time.UTC)),
189189
},
190+
{
191+
Id: "run2",
192+
Status: datapipelinesPb.DataPipelineRunStatus_DATA_PIPELINE_RUN_STATUS_FAILED,
193+
StartTime: timestamppb.New(time.Date(2023, 1, 1, 12, 0, 0, 0, time.UTC)),
194+
EndTime: timestamppb.New(time.Date(2023, 1, 1, 12, 5, 0, 0, time.UTC)),
195+
DataStartTime: timestamppb.New(time.Date(2023, 1, 1, 11, 0, 0, 0, time.UTC)),
196+
DataEndTime: timestamppb.New(time.Date(2023, 1, 1, 12, 30, 0, 0, time.UTC)),
197+
ErrorMessage: "error message",
198+
},
190199
}
191200
dataPipelineRuns = []*DataPipelineRun{
192201
{
@@ -197,6 +206,15 @@ var (
197206
DataStartTime: time.Date(2023, 1, 1, 11, 0, 0, 0, time.UTC),
198207
DataEndTime: time.Date(2023, 1, 1, 12, 30, 0, 0, time.UTC),
199208
},
209+
{
210+
ID: "run2",
211+
Status: DataPipelineRunStatusFailed,
212+
StartTime: time.Date(2023, 1, 1, 12, 0, 0, 0, time.UTC),
213+
EndTime: time.Date(2023, 1, 1, 12, 5, 0, 0, time.UTC),
214+
DataStartTime: time.Date(2023, 1, 1, 11, 0, 0, 0, time.UTC),
215+
DataEndTime: time.Date(2023, 1, 1, 12, 30, 0, 0, time.UTC),
216+
ErrorMessage: "error message",
217+
},
200218
}
201219
)
202220

cli/datapipelines.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ func DatapipelineDescribeAction(c *cli.Context, args datapipelineDescribeArgs) e
211211
if r.GetEndTime() != nil {
212212
printf(c.App.Writer, " Ended: %s", r.GetEndTime().AsTime().Format(time.RFC3339))
213213
}
214+
if r.GetErrorMessage() != "" {
215+
printf(c.App.Writer, " Error: %s", r.GetErrorMessage())
216+
}
214217
} else {
215218
printf(c.App.Writer, "Has not run yet.")
216219
}

0 commit comments

Comments
 (0)