Skip to content

Commit

Permalink
Merge pull request #495 from Tansy-Tansy/tansyka
Browse files Browse the repository at this point in the history
fix: draw figure bug
  • Loading branch information
zainhoda authored Jun 18, 2024
2 parents 76b3a24 + 6a9c115 commit 31d419b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/vanna/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,12 @@ def download_csv(user: any, id: str, df):
def generate_plotly_figure(user: any, id: str, df, question, sql):
chart_instructions = flask.request.args.get('chart_instructions')

if chart_instructions is not None:
question = f"{question}. When generating the chart, use these special instructions: {chart_instructions}"

try:
# If chart_instructions is not set then attempt to retrieve the code from the cache
if chart_instructions is None or len(chart_instructions) == 0:
code = self.cache.get(id=id, field="plotly_code")

if code is None:
else:
question = f"{question}. When generating the chart, use these special instructions: {chart_instructions}"
code = vn.generate_plotly_code(
question=question,
sql=sql,
Expand Down

0 comments on commit 31d419b

Please sign in to comment.