Add executionDate to ingestionPipeline (#6481)

This commit is contained in:
Pere Miquel Brull 2022-08-03 08:13:55 +02:00 committed by GitHub
parent dd8b7fb5b0
commit dc712e3179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View File

@ -28,11 +28,15 @@
},
"startDate": {
"description": "startDate of the pipeline run for this particular execution.",
"type": "string"
"$ref": "../../../type/basic.json#/definitions/timestamp"
},
"executionDate": {
"description": "executionDate of the pipeline run for this particular execution.",
"$ref": "../../../type/basic.json#/definitions/timestamp"
},
"endDate": {
"description": "endDate of the pipeline run for this particular execution.",
"type": "string"
"$ref": "../../../type/basic.json#/definitions/timestamp"
}
},
"additionalProperties": false

View File

@ -20,6 +20,7 @@ from flask import Response
from metadata.generated.schema.entity.services.ingestionPipelines.ingestionPipeline import (
PipelineStatus,
)
from metadata.utils.helpers import datetime_to_ts
class ApiResponse:
@ -78,12 +79,9 @@ class ResponseFormat:
return PipelineStatus(
state=dag_run.get_state(),
runId=dag_run.run_id,
startDate=None
if not dag_run.start_date
else dag_run.start_date.strftime("%Y-%m-%dT%H:%M:%S.%f%z"),
endDate=None
if not dag_run.end_date
else dag_run.end_date.strftime("%Y-%m-%dT%H:%M:%S.%f%z"),
startDate=datetime_to_ts(dag_run.start_date),
endDate=datetime_to_ts(dag_run.end_date),
executionDate=datetime_to_ts(dag_run.execution_date),
)
@staticmethod

View File

@ -310,10 +310,13 @@ const Ingestion: React.FC<IngestionProps> = ({
/>
);
return r?.endDate || r?.startDate ? (
return r?.endDate || r?.startDate || r?.executionDate ? (
<PopOver
html={
<div className="tw-text-left">
{r.executionDate ? (
<p>Execution Date: {new Date(r.executionDate).toUTCString()}</p>
) : null}
{r.startDate ? (
<p>Start Date: {new Date(r.startDate).toUTCString()}</p>
) : null}