Spaces:
Sleeping
Sleeping
Melika Kheirieh
commited on
Commit
·
ccefd8e
1
Parent(s):
99fa656
style: apply pre-commit autofixes (EOF, ruff-format)
Browse files- app/main.py +5 -0
- tests/test_nl2sql_router.py +3 -3
app/main.py
CHANGED
|
@@ -113,3 +113,8 @@ def health():
|
|
| 113 |
def metrics():
|
| 114 |
data = generate_latest(REGISTRY)
|
| 115 |
return Response(content=data, media_type=CONTENT_TYPE_LATEST)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
def metrics():
|
| 114 |
data = generate_latest(REGISTRY)
|
| 115 |
return Response(content=data, media_type=CONTENT_TYPE_LATEST)
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
# Backward compatibility for tests & uvicorn targets
|
| 119 |
+
app: FastAPI = application
|
| 120 |
+
__all__ = ["application", "app"]
|
tests/test_nl2sql_router.py
CHANGED
|
@@ -31,7 +31,7 @@ def test_ambiguity_route(monkeypatch):
|
|
| 31 |
traces=[fake_trace("detector")],
|
| 32 |
)
|
| 33 |
|
| 34 |
-
monkeypatch.setattr(nl2sql.
|
| 35 |
|
| 36 |
resp = client.post(
|
| 37 |
path,
|
|
@@ -64,7 +64,7 @@ def test_error_route(monkeypatch):
|
|
| 64 |
traces=[fake_trace("safety")],
|
| 65 |
)
|
| 66 |
|
| 67 |
-
monkeypatch.setattr(nl2sql.
|
| 68 |
|
| 69 |
resp = client.post(
|
| 70 |
path,
|
|
@@ -94,7 +94,7 @@ def test_success_route(monkeypatch):
|
|
| 94 |
traces=[fake_trace("planner"), fake_trace("generator")],
|
| 95 |
)
|
| 96 |
|
| 97 |
-
monkeypatch.setattr(nl2sql.
|
| 98 |
|
| 99 |
resp = client.post(
|
| 100 |
path,
|
|
|
|
| 31 |
traces=[fake_trace("detector")],
|
| 32 |
)
|
| 33 |
|
| 34 |
+
monkeypatch.setattr(nl2sql.Pipeline, "run", fake_run)
|
| 35 |
|
| 36 |
resp = client.post(
|
| 37 |
path,
|
|
|
|
| 64 |
traces=[fake_trace("safety")],
|
| 65 |
)
|
| 66 |
|
| 67 |
+
monkeypatch.setattr(nl2sql.Pipeline, "run", fake_run)
|
| 68 |
|
| 69 |
resp = client.post(
|
| 70 |
path,
|
|
|
|
| 94 |
traces=[fake_trace("planner"), fake_trace("generator")],
|
| 95 |
)
|
| 96 |
|
| 97 |
+
monkeypatch.setattr(nl2sql.Pipeline, "run", fake_run)
|
| 98 |
|
| 99 |
resp = client.post(
|
| 100 |
path,
|