This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 7206fd7 Allow null schedule_interval in OpenAPI spec for DAGs (#11532)
7206fd7 is described below
commit 7206fd7d542450c6239947ba007a91534f0a57b9
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Mon Oct 19 11:03:17 2020 +0100
Allow null schedule_interval in OpenAPI spec for DAGs (#11532)
---
airflow/api_connexion/openapi/v1.yaml | 1 +
tests/api_connexion/endpoints/test_dag_endpoint.py | 29 ++++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/airflow/api_connexion/openapi/v1.yaml
b/airflow/api_connexion/openapi/v1.yaml
index 4d0a4f9..d1762ba 100644
--- a/airflow/api_connexion/openapi/v1.yaml
+++ b/airflow/api_connexion/openapi/v1.yaml
@@ -2372,6 +2372,7 @@ components:
properties:
__type: {type: string}
value: {type: string}
+ nullable: true
Timezone:
type: string
diff --git a/tests/api_connexion/endpoints/test_dag_endpoint.py
b/tests/api_connexion/endpoints/test_dag_endpoint.py
index 6238e87..a3a9f40 100644
--- a/tests/api_connexion/endpoints/test_dag_endpoint.py
+++ b/tests/api_connexion/endpoints/test_dag_endpoint.py
@@ -123,6 +123,35 @@ class TestGetDag(TestDagEndpoint):
current_response,
)
+ @provide_session
+ def test_should_response_200_with_schedule_interval_none(self,
session=None):
+ dag_model = DagModel(
+ dag_id="TEST_DAG_1",
+ fileloc="/tmp/dag_1.py",
+ schedule_interval=None,
+ )
+ session.add(dag_model)
+ session.commit()
+ response = self.client.get("/api/v1/dags/TEST_DAG_1",
environ_overrides={'REMOTE_USER': "test"})
+ assert response.status_code == 200
+
+ current_response = response.json
+ current_response["fileloc"] = "/tmp/test-dag.py"
+ self.assertEqual(
+ {
+ "dag_id": "TEST_DAG_1",
+ "description": None,
+ "fileloc": "/tmp/test-dag.py",
+ "is_paused": False,
+ "is_subdag": False,
+ "owners": [],
+ "root_dag_id": None,
+ "schedule_interval": None,
+ "tags": [],
+ },
+ current_response,
+ )
+
def test_should_response_200_with_granular_dag_access(self):
self._create_dag_models(1)
response = self.client.get(