Spaces:
Runtime error
Runtime error
Wen-Ding Li
commited on
Commit
·
50b49a8
1
Parent(s):
9ce13ca
pretty sql
Browse files- app.py +4 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import json
|
3 |
from datasets import load_dataset
|
|
|
4 |
|
5 |
st.set_page_config(page_title="BIRD SQL inspection", layout="wide")
|
6 |
|
@@ -26,5 +27,7 @@ st.markdown(f'<h2 style="color:blue;">Database {db_id} schema:</h2>', unsafe_all
|
|
26 |
st.code(samples[index_example]["schema"])
|
27 |
st.markdown(f'<h2 style="color:blue;">{index_example} Question:</h2>', unsafe_allow_html=True)
|
28 |
st.code(samples[index_example]["question"])
|
|
|
|
|
29 |
st.markdown(f'<h2 style="color:blue;">{index_example} SQL:</h2>', unsafe_allow_html=True)
|
30 |
-
st.code(
|
|
|
1 |
import streamlit as st
|
2 |
import json
|
3 |
from datasets import load_dataset
|
4 |
+
import sqlparse
|
5 |
|
6 |
st.set_page_config(page_title="BIRD SQL inspection", layout="wide")
|
7 |
|
|
|
27 |
st.code(samples[index_example]["schema"])
|
28 |
st.markdown(f'<h2 style="color:blue;">{index_example} Question:</h2>', unsafe_allow_html=True)
|
29 |
st.code(samples[index_example]["question"])
|
30 |
+
sql_str = samples[index_example]["SQL"]
|
31 |
+
sql_str_pretty = sqlparse.format(sql_str, reindent=True, keyword_case='upper')
|
32 |
st.markdown(f'<h2 style="color:blue;">{index_example} SQL:</h2>', unsafe_allow_html=True)
|
33 |
+
st.code(sql_str_pretty)
|
requirements.txt
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
protobuf~=3.19.0
|
2 |
-
altair==4.2.2
|
|
|
|
1 |
protobuf~=3.19.0
|
2 |
+
altair==4.2.2
|
3 |
+
sqlparse
|