Skip to content

Commit 46b3e7e

Browse files
authored
Feat: support flask v1 via using route (#1510)
1 parent 7b5ed2b commit 46b3e7e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • sqlmesh/schedulers/airflow

sqlmesh/schedulers/airflow/api.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def wrapper(*args: t.Any, **kwargs: t.Any) -> t.Any:
3232
return wrapper
3333

3434

35-
@sqlmesh_api_v1.post("/plans")
35+
@sqlmesh_api_v1.route("/plans", methods=["POST"])
3636
@csrf.exempt
3737
@check_authentication
3838
def apply_plan() -> Response:
@@ -48,7 +48,7 @@ def apply_plan() -> Response:
4848
return make_response(jsonify(request_id=spec.request_id), 201)
4949

5050

51-
@sqlmesh_api_v1.get("/environments/<name>")
51+
@sqlmesh_api_v1.route("/environments/<name>")
5252
@csrf.exempt
5353
@check_authentication
5454
def get_environment(name: str) -> Response:
@@ -59,7 +59,7 @@ def get_environment(name: str) -> Response:
5959
return _success(environment)
6060

6161

62-
@sqlmesh_api_v1.get("/environments")
62+
@sqlmesh_api_v1.route("/environments")
6363
@csrf.exempt
6464
@check_authentication
6565
def get_environments() -> Response:
@@ -68,7 +68,7 @@ def get_environments() -> Response:
6868
return _success(common.EnvironmentsResponse(environments=environments))
6969

7070

71-
@sqlmesh_api_v1.get("/environments/<name>/max_interval_end")
71+
@sqlmesh_api_v1.route("/environments/<name>/max_interval_end")
7272
@csrf.exempt
7373
@check_authentication
7474
def get_max_interval_end(name: str) -> Response:
@@ -80,7 +80,7 @@ def get_max_interval_end(name: str) -> Response:
8080
return _success(response)
8181

8282

83-
@sqlmesh_api_v1.delete("/environments/<name>")
83+
@sqlmesh_api_v1.route("/environments/<name>", methods=["DELETE"])
8484
@csrf.exempt
8585
@check_authentication
8686
def invalidate_environment(name: str) -> Response:
@@ -93,7 +93,7 @@ def invalidate_environment(name: str) -> Response:
9393
return _success(common.InvalidateEnvironmentResponse(name=name))
9494

9595

96-
@sqlmesh_api_v1.get("/snapshots")
96+
@sqlmesh_api_v1.route("/snapshots")
9797
@csrf.exempt
9898
@check_authentication
9999
def get_snapshots() -> Response:
@@ -114,7 +114,7 @@ def get_snapshots() -> Response:
114114
return _success(common.SnapshotsResponse(snapshots=snapshots))
115115

116116

117-
@sqlmesh_api_v1.get("/models")
117+
@sqlmesh_api_v1.route("/models")
118118
@csrf.exempt
119119
@check_authentication
120120
def nodes_exist() -> Response:
@@ -125,7 +125,7 @@ def nodes_exist() -> Response:
125125
return _success(common.ExistingModelsResponse(names=list(existing_models)))
126126

127127

128-
@sqlmesh_api_v1.get("/versions")
128+
@sqlmesh_api_v1.route("/versions")
129129
@csrf.exempt
130130
@check_authentication
131131
def get_versions() -> Response:

0 commit comments

Comments
 (0)