This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 76ceeb4e4a Numeric values in DAG details are incorrectly rendered as
timestamps (#35538)
76ceeb4e4a is described below
commit 76ceeb4e4a4c7cbb4f0ba7cfebca4c24d2f7c3e1
Author: Ivan <[email protected]>
AuthorDate: Tue Nov 14 17:43:37 2023 +0000
Numeric values in DAG details are incorrectly rendered as timestamps
(#35538)
* Numeric values in DAG details are incorrectly rendered as timestamps
* removed logs
* improved comment
* static check
---
airflow/www/static/js/dag/details/Dag.tsx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/airflow/www/static/js/dag/details/Dag.tsx
b/airflow/www/static/js/dag/details/Dag.tsx
index a17ae4352b..067416ede3 100644
--- a/airflow/www/static/js/dag/details/Dag.tsx
+++ b/airflow/www/static/js/dag/details/Dag.tsx
@@ -130,8 +130,14 @@ const Dag = () => {
const lastStart = dagRuns[dagRuns.length - 1]?.startDate;
// parse value for each key if date or not
+ // check "!Number.isNaN(value)" is needed due to
+ // Date.parse() sometimes returning valid date's timestamp for numbers.
const parseStringData = (value: string) =>
- Number.isNaN(Date.parse(value)) ? value : <Time dateTime={value} />;
+ Number.isNaN(Date.parse(value)) || !Number.isNaN(value) ? (
+ value
+ ) : (
+ <Time dateTime={value} />
+ );
// render dag and dag_details data
const renderDagDetailsData = (