cornflow 2.0.0a12__py3-none-any.whl → 2.0.0a13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cornflow/schemas/execution.py +1 -0
- cornflow/tests/const.py +1 -0
- cornflow/tests/unit/test_executions.py +90 -37
- {cornflow-2.0.0a12.dist-info → cornflow-2.0.0a13.dist-info}/METADATA +2 -2
- {cornflow-2.0.0a12.dist-info → cornflow-2.0.0a13.dist-info}/RECORD +8 -8
- {cornflow-2.0.0a12.dist-info → cornflow-2.0.0a13.dist-info}/WHEEL +1 -1
- {cornflow-2.0.0a12.dist-info → cornflow-2.0.0a13.dist-info}/entry_points.txt +0 -0
- {cornflow-2.0.0a12.dist-info → cornflow-2.0.0a13.dist-info}/top_level.txt +0 -0
cornflow/schemas/execution.py
CHANGED
cornflow/tests/const.py
CHANGED
@@ -15,6 +15,7 @@ INSTANCE_URL = PREFIX + "/instance/"
|
|
15
15
|
INSTANCE_MPS = _get_file("./data/test_mps.mps")
|
16
16
|
INSTANCE_GC_20 = _get_file("./data/gc_20_7.json")
|
17
17
|
INSTANCE_FILE_FAIL = _get_file("./unit/test_instances.py")
|
18
|
+
EDIT_EXECUTION_SOLUTION = _get_file("./data/edit_execution_solution.json")
|
18
19
|
|
19
20
|
EXECUTION_PATH = _get_file("./data/new_execution.json")
|
20
21
|
BAD_EXECUTION_PATH = _get_file("./data/bad_execution.json")
|
@@ -19,7 +19,7 @@ from cornflow.tests.const import (
|
|
19
19
|
INSTANCE_URL,
|
20
20
|
DAG_URL,
|
21
21
|
BAD_EXECUTION_PATH,
|
22
|
-
EXECUTION_SOLUTION_PATH,
|
22
|
+
EXECUTION_SOLUTION_PATH, EDIT_EXECUTION_SOLUTION,
|
23
23
|
)
|
24
24
|
from cornflow.tests.custom_test_case import CustomTestCase, BaseTestCases
|
25
25
|
from cornflow.tests.unit.tools import patch_af_client, patch_db_client
|
@@ -473,6 +473,7 @@ class TestExecutionsDetailEndpointMock(CustomTestCase):
|
|
473
473
|
with open(INSTANCE_PATH) as f:
|
474
474
|
payload = json.load(f)
|
475
475
|
fk_id = self.create_new_row(INSTANCE_URL, InstanceModel, payload)
|
476
|
+
self.instance_payload = payload
|
476
477
|
self.model = ExecutionModel
|
477
478
|
self.response_items = {
|
478
479
|
"id",
|
@@ -523,51 +524,41 @@ class TestExecutionsDetailEndpointAirflow(
|
|
523
524
|
self.assertEqual(200, response.status_code)
|
524
525
|
self.assertEqual(response.json["message"], "The execution has been stopped")
|
525
526
|
|
527
|
+
def test_edit_execution(self):
|
526
528
|
|
527
|
-
|
528
|
-
|
529
|
-
):
|
530
|
-
def setUp(self):
|
531
|
-
super().setUp()
|
532
|
-
self.url = self.url
|
533
|
-
self.query_arguments = {"run": 0}
|
534
|
-
|
535
|
-
def create_app(self):
|
536
|
-
app = create_app("testing-databricks")
|
537
|
-
return app
|
538
|
-
|
539
|
-
@patch("cornflow.endpoints.execution.Databricks")
|
540
|
-
def test_stop_execution(self, db_client_class):
|
541
|
-
patch_db_client(db_client_class)
|
542
|
-
|
543
|
-
idx = self.create_new_row(EXECUTION_URL, self.model, payload=self.payload)
|
544
|
-
|
545
|
-
response = self.client.post(
|
546
|
-
self.url + str(idx) + "/",
|
547
|
-
follow_redirects=True,
|
548
|
-
headers=self.get_header_with_auth(self.token),
|
529
|
+
id_new_instance = self.create_new_row(
|
530
|
+
INSTANCE_URL, InstanceModel, self.instance_payload
|
549
531
|
)
|
550
|
-
|
551
|
-
|
552
|
-
self.assertEqual(
|
553
|
-
response.json["message"], "This feature is not available for Databricks"
|
532
|
+
idx = self.create_new_row(
|
533
|
+
self.url_with_query_arguments(), self.model, self.payload
|
554
534
|
)
|
555
535
|
|
536
|
+
# Extract the data from data/edit_execution_solution.json
|
537
|
+
with open(EDIT_EXECUTION_SOLUTION) as f:
|
538
|
+
data = json.load(f)
|
556
539
|
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
540
|
+
data = {
|
541
|
+
"name": "new_name",
|
542
|
+
"description": "Updated description",
|
543
|
+
"data": data,
|
544
|
+
"instance_id": id_new_instance,
|
545
|
+
}
|
546
|
+
payload_to_check = {
|
547
|
+
"id": idx,
|
548
|
+
"name":"new_name",
|
549
|
+
"description":"Updated description",
|
550
|
+
"data_hash":"74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b",
|
551
|
+
"instance_id":"805bad3280c95e45384dc6bd91a41317f9a7858c",
|
552
|
+
}
|
553
|
+
self.update_row(
|
554
|
+
self.url + str(idx) + "/",
|
555
|
+
data,
|
556
|
+
payload_to_check,
|
557
|
+
)
|
566
558
|
|
567
559
|
@patch("cornflow.endpoints.execution.Airflow")
|
568
560
|
def test_get_one_status(self, af_client_class):
|
569
561
|
patch_af_client(af_client_class)
|
570
|
-
|
571
562
|
idx = self.create_new_row(EXECUTION_URL, self.model, payload=self.payload)
|
572
563
|
payload = dict(self.payload)
|
573
564
|
payload["id"] = idx
|
@@ -597,6 +588,68 @@ class TestExecutionsStatusEndpointAirflow(TestExecutionsDetailEndpointMock):
|
|
597
588
|
self.assertEqual(200, response.status_code)
|
598
589
|
self.assertEqual(f"execution {idx} updated correctly", response.json["message"])
|
599
590
|
|
591
|
+
class TestExecutionsDetailEndpointDatabricks(
|
592
|
+
TestExecutionsDetailEndpointMock, BaseTestCases.DetailEndpoint
|
593
|
+
):
|
594
|
+
def setUp(self):
|
595
|
+
super().setUp()
|
596
|
+
self.url = self.url
|
597
|
+
self.query_arguments = {"run": 0}
|
598
|
+
|
599
|
+
def create_app(self):
|
600
|
+
app = create_app("testing-databricks")
|
601
|
+
return app
|
602
|
+
|
603
|
+
@patch("cornflow.endpoints.execution.Databricks")
|
604
|
+
def test_stop_execution(self, db_client_class):
|
605
|
+
patch_db_client(db_client_class)
|
606
|
+
|
607
|
+
idx = self.create_new_row(EXECUTION_URL, self.model, payload=self.payload)
|
608
|
+
|
609
|
+
response = self.client.post(
|
610
|
+
self.url + str(idx) + "/",
|
611
|
+
follow_redirects=True,
|
612
|
+
headers=self.get_header_with_auth(self.token),
|
613
|
+
)
|
614
|
+
|
615
|
+
self.assertEqual(200, response.status_code)
|
616
|
+
self.assertEqual(
|
617
|
+
response.json["message"], "This feature is not available for Databricks"
|
618
|
+
)
|
619
|
+
def test_edit_execution(self):
|
620
|
+
|
621
|
+
id_new_instance = self.create_new_row(
|
622
|
+
INSTANCE_URL, InstanceModel, self.instance_payload
|
623
|
+
)
|
624
|
+
idx = self.create_new_row(
|
625
|
+
self.url_with_query_arguments(), self.model, self.payload
|
626
|
+
)
|
627
|
+
|
628
|
+
# Extract the data from data/edit_execution_solution.json
|
629
|
+
with open(EDIT_EXECUTION_SOLUTION) as f:
|
630
|
+
data = json.load(f)
|
631
|
+
|
632
|
+
data = {
|
633
|
+
"name": "new_name",
|
634
|
+
"description": "Updated description",
|
635
|
+
"data": data,
|
636
|
+
"instance_id": id_new_instance,
|
637
|
+
}
|
638
|
+
payload_to_check = {
|
639
|
+
"id": idx,
|
640
|
+
"name":"new_name",
|
641
|
+
"description":"Updated description",
|
642
|
+
"data_hash":"74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b",
|
643
|
+
"instance_id":"805bad3280c95e45384dc6bd91a41317f9a7858c",
|
644
|
+
}
|
645
|
+
self.update_row(
|
646
|
+
self.url + str(idx) + "/",
|
647
|
+
data,
|
648
|
+
payload_to_check,
|
649
|
+
)
|
650
|
+
|
651
|
+
|
652
|
+
|
600
653
|
|
601
654
|
class TestExecutionsStatusEndpointDatabricks(TestExecutionsDetailEndpointMock):
|
602
655
|
def setUp(self):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: cornflow
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.0a13
|
4
4
|
Summary: cornflow is an open source multi-solver optimization server with a REST API built using flask.
|
5
5
|
Home-page: https://github.com/baobabsoluciones/cornflow
|
6
6
|
Author: baobab soluciones
|
@@ -14,7 +14,7 @@ Requires-Dist: alembic==1.9.2
|
|
14
14
|
Requires-Dist: apispec<=6.3.0
|
15
15
|
Requires-Dist: cachetools==5.3.3
|
16
16
|
Requires-Dist: click<=8.1.7
|
17
|
-
Requires-Dist: cornflow-client==2.0.
|
17
|
+
Requires-Dist: cornflow-client==2.0.0a13
|
18
18
|
Requires-Dist: cryptography<=44.0.1
|
19
19
|
Requires-Dist: databricks-sdk==0.29.0
|
20
20
|
Requires-Dist: disposable-email-domains>=0.0.86
|
@@ -104,7 +104,7 @@ cornflow/schemas/case.py,sha256=OXRsDi_sdB47MQJ59S_1eMjDmLlpUtG7kTFNInV2-cI,2909
|
|
104
104
|
cornflow/schemas/common.py,sha256=QYuxWcOl4smXFZr_vL07OVgH9H50ZywCrXxycVNr1qA,473
|
105
105
|
cornflow/schemas/dag.py,sha256=0ENA75X9L8YqjJW6ZO1Sb4zE8OxB15_O49_nwA6eAVw,901
|
106
106
|
cornflow/schemas/example_data.py,sha256=hbE8TJakFqOweHXiA3mduNETM6FCX6xLTiQuH3EkSTc,281
|
107
|
-
cornflow/schemas/execution.py,sha256=
|
107
|
+
cornflow/schemas/execution.py,sha256=99vqMSpX-KUNN5DF6ibasvyRmapOdkGWiHCdqnm009o,4759
|
108
108
|
cornflow/schemas/health.py,sha256=8ptyAJc23HTgb-dgtFFEtowFrlwILgkZdgezJ-JSMDY,141
|
109
109
|
cornflow/schemas/instance.py,sha256=qr4km0AlAhoNf9G1Il-pfHphT_vAiiLDpv7A9S3FKAw,1870
|
110
110
|
cornflow/schemas/main_alarms.py,sha256=cC1_Vb1dmo_vdZpZQrA7jH-hRCjVtLRy6Z2JFBlTrlo,604
|
@@ -136,7 +136,7 @@ cornflow/shared/authentication/auth.py,sha256=oCWW3cUxaKYgGi-4--m4sYVBr4T5MzsR_f
|
|
136
136
|
cornflow/shared/authentication/decorators.py,sha256=_QpwOU1kYzpaK85Dl0Btdj5hG8Ps47PFgySp_gqhlgk,1276
|
137
137
|
cornflow/shared/authentication/ldap.py,sha256=QfdC2X_ZMcIJabKC5pYWDGMhS5pIOJJvdZXuuiruq-M,4853
|
138
138
|
cornflow/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
139
|
-
cornflow/tests/const.py,sha256=
|
139
|
+
cornflow/tests/const.py,sha256=DvFhKS5WXR01962bAlTTDtEhyXCtKpUtTcY0FiEXTeY,2636
|
140
140
|
cornflow/tests/custom_liveServer.py,sha256=I_0YNrcKIwVmRov3zCQMWwcCWkMe5V246Hpa4gS8AZE,3079
|
141
141
|
cornflow/tests/custom_test_case.py,sha256=gW6S0qwNtMWli-5ZCYzUzkjah3QiybKUJcJXrdR3JLw,37919
|
142
142
|
cornflow/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -155,7 +155,7 @@ cornflow/tests/unit/test_commands.py,sha256=V0XFiiTrq9PctgnzGLMmBbjBFtofLBbnFWcO
|
|
155
155
|
cornflow/tests/unit/test_dags.py,sha256=X9NmzWWOzOje05PLTyV1NcwzyX-BvKI8ptrRgoukMO0,13388
|
156
156
|
cornflow/tests/unit/test_data_checks.py,sha256=6s50d1iuRTUcAYn14oEcRS39ZZ6E9ussU4YpkpYhtC4,8612
|
157
157
|
cornflow/tests/unit/test_example_data.py,sha256=rCj3wNW4OMHyLfuPdIKxBa7-eRuFsymij-9Nk27_Z3o,4128
|
158
|
-
cornflow/tests/unit/test_executions.py,sha256
|
158
|
+
cornflow/tests/unit/test_executions.py,sha256=ucgqXBse2Y7rbQ6rvRNB0b60tCTAOmRIO3xYyAGpDXc,30074
|
159
159
|
cornflow/tests/unit/test_generate_from_schema.py,sha256=L1EdnASbDJ8SjrX1V4WnUKKwV0sRTwVnNYnxSpyeSeQ,15376
|
160
160
|
cornflow/tests/unit/test_health.py,sha256=er-CkoYI3Nb9lq0pGn-rIbhfIigxXI5wYNFNn-OsAoc,1043
|
161
161
|
cornflow/tests/unit/test_instances.py,sha256=Mf9jijQOcDE3ylPfMTnVRocRegcugEdCnoMCqSmKKqQ,11083
|
@@ -172,8 +172,8 @@ cornflow/tests/unit/test_tables.py,sha256=7lZsdun8_SWvYO-6ezQeuTxRat_fyP9vCfXoU7
|
|
172
172
|
cornflow/tests/unit/test_token.py,sha256=PZ11b46UCQpCESsRiAPhpgWkGAsAwKCVNxVQai_kxXM,4199
|
173
173
|
cornflow/tests/unit/test_users.py,sha256=N5tcF5nSncD0F_ZlBxGuS87p6kNS4hUzRLr3_AcnK-o,22802
|
174
174
|
cornflow/tests/unit/tools.py,sha256=F5nk7G7k9NkT_EGQvf-E-sML3Y8IpzmD7bMztsap6CQ,3166
|
175
|
-
cornflow-2.0.
|
176
|
-
cornflow-2.0.
|
177
|
-
cornflow-2.0.
|
178
|
-
cornflow-2.0.
|
179
|
-
cornflow-2.0.
|
175
|
+
cornflow-2.0.0a13.dist-info/METADATA,sha256=MQQ9oWFSn0kHFwyB-552yIlz8zk3BCkxB9iflm-NkSg,9571
|
176
|
+
cornflow-2.0.0a13.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
177
|
+
cornflow-2.0.0a13.dist-info/entry_points.txt,sha256=q9cPKAFBsmHkERCqQ2JcOTM-tVBLHTl-DGxwCXowAWM,46
|
178
|
+
cornflow-2.0.0a13.dist-info/top_level.txt,sha256=Qj9kLFJW1PLb-ZV2s_aCkQ-Wi5W6KC6fFR-LTBrx-rU,24
|
179
|
+
cornflow-2.0.0a13.dist-info/RECORD,,
|
File without changes
|
File without changes
|