File tree Expand file tree Collapse file tree 2 files changed +32
-4
lines changed Expand file tree Collapse file tree 2 files changed +32
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Test
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request_target :
8
+ branches :
9
+ - main
10
+
11
+ jobs :
12
+ test :
13
+ name : Test
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v4
18
+ - name : Install uv
19
+ uses : astral-sh/setup-uv@v5
20
+ with :
21
+ enable-cache : true
22
+ - name : Install dependencies
23
+ run : uv sync --all-extras --dev
24
+ - name : Run Lint
25
+ run : uv tool run ruff check
26
+ - name : Run Format
27
+ run : uv tool run ruff format
28
+ - name : Run Test
29
+ run : uv run pytest tests
30
+
Original file line number Diff line number Diff line change @@ -67,9 +67,7 @@ class QuestionSQLResponse(BaseModel):
67
67
table_definitions = []
68
68
current_database = db ._db_engine .url .database
69
69
for table_name in db .table_names ():
70
- table_definitions .append (
71
- db .query (f"SHOW CREATE TABLE `{ table_name } `" ).to_rows ()[0 ]
72
- )
70
+ table_definitions .append (db .query (f"SHOW CREATE TABLE `{ table_name } `" ).to_rows ()[0 ])
73
71
74
72
75
73
def on_submit ():
@@ -98,7 +96,7 @@ def on_submit():
98
96
)
99
97
st .session_state .past .append (user_input )
100
98
101
- if ' insert' in response .sql .lower () or ' update' in response .sql .lower ():
99
+ if " insert" in response .sql .lower () or " update" in response .sql .lower ():
102
100
st .error (
103
101
"The generated SQL is not a SELECT statement, please check it carefully before running it."
104
102
)
You can’t perform that action at this time.
0 commit comments