fix(reports): log duration and sort column (#12039)

This commit is contained in:
Daniel Vaz Gaspar 2020-12-15 08:44:30 +00:00 committed by GitHub
parent 20b1aa7d6c
commit 832267c776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -111,7 +111,8 @@ function ExecutionLog({ addDangerToast, isReportEnabled }: ExecutionLogProps) {
row: {
original: { start_dttm: startDttm, end_dttm: endDttm },
},
}: any) => fDuration(endDttm - startDttm),
}: any) =>
fDuration(new Date(startDttm).getTime(), new Date(endDttm).getTime()),
Header: t('Duration'),
disableSortBy: true,
},

View File

@ -147,6 +147,7 @@ class ReportScheduleRestApi(BaseSupersetModelRestApi):
"changed_on",
"changed_on_delta_humanized",
"created_on",
"crontab",
"name",
"type",
"crontab_humanized",
@ -205,7 +206,7 @@ class ReportScheduleRestApi(BaseSupersetModelRestApi):
try:
DeleteReportScheduleCommand(g.user, pk).run()
return self.response(200, message="OK")
except ReportScheduleNotFoundError as ex:
except ReportScheduleNotFoundError:
return self.response_404()
except ReportScheduleForbiddenError:
return self.response_403()

View File

@ -64,6 +64,7 @@ class ReportExecutionLogRestApi(BaseSupersetModelRestApi):
"error_message",
"end_dttm",
"start_dttm",
"scheduled_dttm",
]
openapi_spec_tag = "Report Schedules"
openapi_spec_methods = openapi_spec_methods_override

View File

@ -199,6 +199,7 @@ class ReportSchedulePutSchema(Schema):
description=sql_description,
example="SELECT value FROM time_series_table",
required=False,
allow_none=True,
)
chart = fields.Integer(required=False)
dashboard = fields.Integer(required=False)
@ -209,6 +210,7 @@ class ReportSchedulePutSchema(Schema):
validate=validate.OneOf(
choices=tuple(key.value for key in ReportScheduleValidatorType)
),
allow_none=True,
required=False,
)
validator_config_json = fields.Nested(ValidatorConfigJSONSchema, required=False)
@ -219,6 +221,9 @@ class ReportSchedulePutSchema(Schema):
description=grace_period_description, example=60 * 60 * 4, required=False
)
working_timeout = fields.Integer(
description=working_timeout_description, example=60 * 60 * 1, required=False
description=working_timeout_description,
example=60 * 60 * 1,
allow_none=True,
required=False,
)
recipients = fields.List(fields.Nested(ReportRecipientSchema), required=False)