File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -179,17 +179,17 @@ def should_show(_key: str) -> bool:
179
179
st .dataframe (df .head (10 ) if len (df ) > 10 else df )
180
180
except Exception as e :
181
181
st .error (f"쿼리 실행 중 오류 발생: { e } " )
182
- if should_show ("show_chart" ) and df is not None :
182
+ if should_show ("show_chart" ):
183
+ df = database .run_sql (sql )
183
184
st .markdown ("**쿼리 결과 시각화:**" )
184
185
display_code = DisplayChart (
185
186
question = res ["refined_input" ].content ,
186
187
sql = sql ,
187
- df_metadata = f"Running df.dtypes gives:\n { df .dtypes } "
188
+ df_metadata = f"Running df.dtypes gives:\n { df .dtypes } " ,
188
189
)
189
190
# plotly_code 변수도 따로 보관할 필요 없이 바로 그려도 됩니다
190
191
fig = display_code .get_plotly_figure (
191
- plotly_code = display_code .generate_plotly_code (),
192
- df = df
192
+ plotly_code = display_code .generate_plotly_code (), df = df
193
193
)
194
194
st .plotly_chart (fig )
195
195
You can’t perform that action at this time.
0 commit comments