pierrejeambrun commented on code in PR #47790:
URL: https://github.com/apache/airflow/pull/47790#discussion_r1999502372


##########
airflow/ui/src/queries/useCreateBackfill.ts:
##########
@@ -50,7 +50,7 @@ export const useCreateBackfill = ({ onSuccessConfirm }: { 
onSuccessConfirm: () =
     const dataIntervalEnd = new Date(data.requestBody.to_date);
     const dagId = data.requestBody.dag_id;
 
-    if (!Boolean(dataIntervalStart) || !Boolean(dataIntervalEnd)) {
+    if (isNaN(dataIntervalStart.getTime()) || 
isNaN(dataIntervalEnd.getTime())) {

Review Comment:
   Is this required ? `!Boolean` check seems clearer to me that calling 
`getTime` and checking for `isNaN`
   
   Otherwise checking explicitely for `null` or `undefined` is better. 



##########
airflow/ui/src/queries/useCreateBackfillDryRun.ts:
##########
@@ -28,12 +28,30 @@ type Props<TData, TError> = {
 
 const useCreateBackfillDryRunKey = "useCreateBackfillDryRunKey";
 
+const validateHeaderName = (requestBody: CreateBackfillDryRunData) => {
+  const dataIntervalStart = new Date(requestBody.requestBody.from_date);
+  const dataIntervalEnd = new Date(requestBody.requestBody.to_date);
+
+  if (isNaN(dataIntervalStart.getTime()) || isNaN(dataIntervalEnd.getTime())) {

Review Comment:
   same here



-- 
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