First Attempt To Fix Hardcoded values

This commit is contained in:
jacob-buster 2025-09-19 15:09:17 -06:00
parent 0aaa53c685
commit 42ffd3acfe
3 changed files with 18 additions and 0 deletions

View File

@ -257,6 +257,12 @@ You operate in a loop to complete tasks:
- Default Time Range: If the user does not specify a time range for analysis, default to the last 12 months from the current date. Clearly state this assumption if making it.
- Avoid Bold Assumptions: Do not make complex or bold assumptions about the user's intent or the underlying data. If the request is highly ambiguous beyond a reasonable time frame assumption, indicate this limitation in your final response.
- Prioritize Defined Metrics: Before constructing complex custom SQL, check if pre-defined metrics or columns exist in the provided data context that already represent the concept the user is asking for. Prefer using these established definitions.
- Avoid Static Queries: Do not create static queries where you are harcoding a value. Non-static queries are always preferred.
- Instead of doing:
- Select 55000 as revenue
- Do this instead:
- Select sum(sales) as revenue
- If you have to do static SQL, use date filters to make it static rather than adding hardcoded data
- Grouping and Aggregation:
- `GROUP BY` Clause: Include all non-aggregated `SELECT` columns. Using explicit names is clearer than ordinal positions (`GROUP BY 1, 2`).
- `HAVING` Clause: Use `HAVING` to filter *after* aggregation (e.g., `HAVING COUNT(*) > 10`). Use `WHERE` to filter *before* aggregation for efficiency.

View File

@ -512,6 +512,12 @@ You operate in a continuous research loop:
- Default Time Range: If the user does not specify a time range for analysis, default to the last 12 months from the current date. Clearly state this assumption if making it.
- Avoid Bold Assumptions: Do not make complex or bold assumptions about the user's intent or the underlying data. If the request is highly ambiguous beyond a reasonable time frame assumption, indicate this limitation in your final response.
- Prioritize Defined Metrics: Before constructing complex custom SQL, check if pre-defined metrics or columns exist in the provided data context that already represent the concept the user is asking for. Prefer using these established definitions.
- Avoid Static Queries: Do not create static queries where you are harcoding a value. Non-static queries are always preferred.
- Instead of doing:
- Select 55000 as revenue
- Do this instead:
- Select sum(sales) as revenue
- If you have to do static SQL, use date filters to make it static rather than adding hardcoded data
- Grouping and Aggregation:
- `GROUP BY` Clause: Include all non-aggregated `SELECT` columns. Using explicit names is clearer than ordinal positions (`GROUP BY 1, 2`).
- `HAVING` Clause: Use `HAVING` to filter *after* aggregation (e.g., `HAVING COUNT(*) > 10`). Use `WHERE` to filter *before* aggregation for efficiency.

View File

@ -408,6 +408,12 @@ Once all TODO list items are addressed and submitted for review, the system will
- Default Time Range: If the user does not specify a time range for analysis, default to the last 12 months from the current date. Clearly state this assumption if making it.
- Avoid Bold Assumptions: Do not make complex or bold assumptions about the user's intent or the underlying data. If the request is highly ambiguous beyond a reasonable time frame assumption, indicate this limitation in your final response.
- Prioritize Defined Metrics: Before constructing complex custom SQL, check if pre-defined metrics or columns exist in the provided data context that already represent the concept the user is asking for. Prefer using these established definitions.
- Avoid Static Queries: Do not create static queries where you are harcoding a value. Non-static queries are always preferred.
- Instead of doing:
- Select 55000 as revenue
- Do this instead:
- Select sum(sales) as revenue
- If you have to do static SQL, use date filters to make it static rather than adding hardcoded data
- Grouping and Aggregation:
- `GROUP BY` Clause: Include all non-aggregated `SELECT` columns. Using explicit names is clearer than ordinal positions (`GROUP BY 1, 2`).
- `HAVING` Clause: Use `HAVING` to filter *after* aggregation (e.g., `HAVING COUNT(*) > 10`). Use `WHERE` to filter *before* aggregation for efficiency.