You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bb...@apache.org on 2025/02/27 19:47:50 UTC
(airflow) branch main updated: AIP-38 Fix log key warning (#47157)
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 2f655dc6488 AIP-38 Fix log key warning (#47157)
2f655dc6488 is described below
commit 2f655dc64888645ad0b60482ac03d54bb54ac366
Author: Pierre Jeambrun <pi...@gmail.com>
AuthorDate: Thu Feb 27 20:47:44 2025 +0100
AIP-38 Fix log key warning (#47157)
---
airflow/ui/src/queries/useLogs.tsx | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/airflow/ui/src/queries/useLogs.tsx b/airflow/ui/src/queries/useLogs.tsx
index 799a01fe4a7..a97f920d82d 100644
--- a/airflow/ui/src/queries/useLogs.tsx
+++ b/airflow/ui/src/queries/useLogs.tsx
@@ -45,20 +45,35 @@ const renderStructuredLog = (logMessage: string | StructuredLogMessage, index: n
const elements = [];
if (Boolean(timestamp)) {
- elements.push("[", <time dateTime={timestamp}>{timestamp}</time>, "] ");
+ elements.push(
+ "[",
+ <time dateTime={timestamp} key={0}>
+ {timestamp}
+ </time>,
+ "] ",
+ );
}
if (typeof level === "string") {
- elements.push(<span className={`log-level ${level}`}>{level.toUpperCase()}</span>, " - ");
+ elements.push(
+ <span className={`log-level ${level}`} key={1}>
+ {level.toUpperCase()}
+ </span>,
+ " - ",
+ );
}
- elements.push(<span className="event">{event}</span>);
+ elements.push(
+ <span className="event" key={2}>
+ {event}
+ </span>,
+ );
for (const key in structured) {
if (Object.hasOwn(structured, key)) {
elements.push(
" ",
- <span className={`log-key ${key}`}>
+ <span className={`log-key ${key}`} key={`prop_${key}`}>
{key}={JSON.stringify(structured[key])}
</span>,
);