Skip to content

Conversation

@milind-soni
Copy link
Collaborator

New Chart Template Prompt with sample templates
Jinja2 instead of fstrings for returning HTML
Other Altair and HTML Specific Guidelines

New Chart Template Prompt with sample templates
Jinja2 instead of fstrings for returning HTML 
Other Altair and HTML Specific Guidelines
housing = load_data(path)

# Inspect schema (useful for debugging)
print("=== Column data types ===")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this? This takes up context space and I don't think adds anything to charting?

Copy link
Collaborator Author

@milind-soni milind-soni Aug 18, 2025

Choose a reason for hiding this comment

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

reverted to the earlier example, as the templates cover this. we need this as sometimes the AI Might get stuck in a loop of "Fix" and it cannot determine the datatype of the columns. This added context helps it to "Fix" it in the next run.

Data Handling Requirements:
- When working with CSV files from external sources, always include encoding handling: Use encoding="latin1" or encoding="utf-8-sig" for broader compatibility
- Always clean column names (strip whitespace, handle special characters) before using them in data visualizations or chart encodings
- NEVER ASSUME THE SCHEMA OF THE DATASET. Always create UDF to look at the sample of the dataset to find it out if you are not sure about the schema
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not too helpful because every UDF has only a single run. Should reframe this on how UDF can get content of tables by getting context from another UDF

Copy link
Collaborator Author

@milind-soni milind-soni Aug 18, 2025

Choose a reason for hiding this comment

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

The behaviour I noticed which led me to add this was that

  • For some partially known/famous dataset, it directly jumps on creating a chart udf, Assuming the column names itself which lead to a lot of errors. We need to think about what happens after we click on "Fix" if and when needed, does it get enough context to debug or not.
  • Can remove the clean column directive - Agreed
  • For CSV Files from a lot of sources, it was giving me encoding errors while reading csv directly without the encoding parameter, which led me to adding this line.

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.

3 participants