OscarLigthart commented on code in PR #63484:
URL: https://github.com/apache/airflow/pull/63484#discussion_r3018853692


##########
airflow-core/src/airflow/ui/src/components/Clear/Run/ClearRunDialog.tsx:
##########
@@ -78,12 +119,14 @@ const ClearRunDialog = ({ dagRun, onClose, open }: Props) 
=> {
     onSuccess: onClose,
   });
 
-  // Check if bundle versions are different
-  const currentDagBundleVersion = dagDetails?.bundle_version;
-  const dagRunBundleVersion = dagRun.bundle_version;
-  const bundleVersionsDiffer = currentDagBundleVersion !== dagRunBundleVersion;
-  const shouldShowBundleVersionOption =
-    bundleVersionsDiffer && dagRunBundleVersion !== null && 
dagRunBundleVersion !== "";
+  // Check if DAG versions differ (works for both bundle-versioned and local 
bundles)
+  const latestDagVersionNumber = 
dagDetails?.latest_dag_version?.version_number;
+  const dagRunVersionNumber = dagRun.dag_versions.at(-1)?.version_number;
+  const versionsDiffer =
+    latestDagVersionNumber !== undefined &&
+    dagRunVersionNumber !== undefined &&
+    latestDagVersionNumber !== dagRunVersionNumber;
+  const shouldShowBundleVersionOption = versionsDiffer && !onlyNew;

Review Comment:
   Wouldn't using `version_number` suffice here? This can't be `null`, so the 
check can be omitted.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to