Skip to content

fix: render agent_description in SQL prompt template#1876

Open
Br1an67 wants to merge 1 commit into
sinaptik-ai:mainfrom
Br1an67:fix/sql-prompt-description-placeholder
Open

fix: render agent_description in SQL prompt template#1876
Br1an67 wants to merge 1 commit into
sinaptik-ai:mainfrom
Br1an67:fix/sql-prompt-description-placeholder

Conversation

@Br1an67

@Br1an67 Br1an67 commented Mar 1, 2026

Copy link
Copy Markdown

Summary

The SQL code generation template never rendered the agent_description stored in memory, making the description parameter passed to Agent() a no-op when using SQL mode. The Python template includes this description at the top, but the SQL template did not.

Changes

Added agent_description rendering at the top of generate_python_code_with_sql.tmpl, consistent with the Python template.

Files changed:

  • pandasai/core/prompts/templates/generate_python_code_with_sql.tmpl — added agent_description block
  • tests/unit_tests/core/prompts/test_generate_python_code_with_sql_prompt.py — added tests for description rendering

Important

Fixes bug by rendering agent_description in SQL prompts, ensuring description parameter is effective.

  • Behavior:
    • Fixes bug where agent_description was not rendered in SQL prompts, making description parameter ineffective.
    • Adds agent_description rendering to generate_python_code_with_sql.tmpl.
  • Tests:
    • Adds test_template_renders_agent_description in test_generate_python_code_with_sql_prompt.py to verify description rendering.
    • Adds test_template_no_description_when_none to ensure no rendering when agent_description is None.

This description was created by Ellipsis for bfda9db. You can customize this summary. It will automatically update as commits are pushed.

The SQL code generation template never rendered the agent_description
stored in memory, even though it was set during Agent initialization.
The Python template includes this description but the SQL template
did not, making the agent_description parameter a no-op for SQL mode.

Add agent_description rendering at the top of
generate_python_code_with_sql.tmpl, consistent with the Python template.

Closes sinaptik-ai#1853

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to bfda9db in 7 seconds. Click for details.
  • Reviewed 72 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_KPudFeNbCAj0U7DJ

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent.description (System Prompt) is dead-code

1 participant