uranusjr commented on code in PR #36630:
URL: https://github.com/apache/airflow/pull/36630#discussion_r1462835969


##########
airflow/api_connexion/schemas/dag_run_schema.py:
##########
@@ -121,6 +121,18 @@ def autofill(self, data, **kwargs):
 
         return ret_data
 
+    @validates_schema
+    def validate_data_interval_dates(self, data, **kwargs):
+        data_interval_start_exists = data.get("data_interval_start") is not 
None
+        data_interval_end_exists = data.get("data_interval_end") is not None
+
+        if (data_interval_start_exists and not data_interval_end_exists) or (
+            data_interval_end_exists and not data_interval_start_exists
+        ):
+            raise ValidationError(
+                "Both 'data_interval_start' and 'data_interval_end' must be 
specified, you cannot specify only one"

Review Comment:
   ```suggestion
                   "Both 'data_interval_start' and 'data_interval_end' must be 
specified together"
   ```



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