1 line
23 KiB
JSON
1 line
23 KiB
JSON
{"repo": "botwu/database", "files": {"base_pandasman_config.yaml": {"a29f56f77bda447bd1229fdc7b2b054764fc4546": {"t": 1785746830.0483289, "n": 9700, "h": "591d18f4e8701dea", "c": "# database_config:\n# mode: \"hive\"\n# try_a_sql_with_limit: 5\n# timeout: 120\n# hive_host: \"172.18.136.23\"\n# hive_port: \"10000\"\n# hive_username: \"sla\"\n# hive_password: \"Sla@transwarp123\"\n# hive_auth: \"LDAP\"\n# hive_database: \"wenshu\"\n# hive_allowed_tables:\n# - \"company_base\"\n# # - \"company_stock\"\n# # - \"company_finance\"\nmax_conversation_turns: 200\n\n\nknowledge_base_config:\n enable: false\n mode: \"empty\"\n\nllm_client:\n api_type: openai\n #base_url: \"http://172.17.120.13/v1\"\n #api_key: \"transwarp\"\n think_first_config:\n first_think_stop_with_p: true\n base_url: \"https://api.deepseek.com\"\n api_key: \"sk-0bf7fd50de534419ab946a677aa346bf\"\n\nllm_inference:\n model: \"deepseek-chat\"\n #model: \"qwen3-coder-30b\"\n # extra_body:\n # chat_template_kwargs:\n # enable_thinking: false\n # model: \"qwen3-coder-30b\"\n max_tokens: 3000\n temperature: 2\n seed: 42\n top_p: 0.8\n presence_penalty: 1.05\n stop: [\"</p>\"]\n extra_body:\n guided_grammar: |\n start: tool_use\n\n tool_use: \"<e>\" TEXT? \"</e>\" \"<t>\" TOOL_NAME \"</t>\" \"<p>\" simple_stmt \"</p>\"\n\n TOOL_NAME: \"run_a_line_of_code\" | \"submit_final_answer\"\n\n TEXT: /[^<`]+/\n\n // ===============\n // SIMPLE STATEMENTS\n // ===============\n\n simple_stmt: assignment\n | testlist\n | import_stmt\n\n assignment: target \"=\" testlist\n\n // 增强赋值(可选,你原语法未用,但建议保留)\n augassign: \"+=\" | \"-=\" | \"*=\" | \"@=\" | \"/=\" | \"%=\" | \"&=\" | \"|=\" | \"^=\" | \"<<=\" | \">>=\" | \"**=\" | \"//=\"\n\n // ===============\n // IMPORTS\n // ===============\n\n import_stmt: import_name | import_from\n\n import_name: \"import\" dotted_as_names\n\n import_from: \"from\" dotted_name \"import\" import_from_targets\n\n import_from_targets: \"(\" import_from_as_names [\",\"] \")\"\n | import_from_as_names\n | \"*\"\n\n import_from_as_names: import_from_as_name (\",\" import_from_as_name)*\n\n import_from_as_name: NAME\n\n dotted_as_names: dotted_as_name (\",\" dotted_as_name)*\n\n dotted_as_name: dotted_name [\"as\" NAME]\n\n dotted_name: NAME (\".\" NAME)*\n\n // ===============\n // EXPRESSIONS\n // ===============\n\n testlist: expression (\",\" expression)* [\",\"]\n\n expression: disjunction (\"if\" disjunction \"else\" expression)?\n | lambdef\n\n disjunction: conjunction (\"or\" conjunction)*\n\n conjunction: inversion (\"and\" inversion)*\n\n inversion: \"not\" inversion\n | comparison\n\n comparison: bitwise_or (comp_op bitwise_or)*\n\n comp_op: \"==\" | \"!=\" | \"<=\" | \"<\" | \">=\" | \">\"\n | \"in\" | \"not\" \"in\"\n | \"is\" [\"not\"]\n\n bitwise_or: bitwise_xor (\"|\" bitwise_xor)*\n\n bitwise_xor: bitwise_and (\"^\" bitwise_and)*\n\n bitwise_and: shift_expr (\"&\" shift_expr)*\n\n shift_expr: sum (\"<<\" sum | \">>\" sum)*\n\n sum: term ((\"+\" | \"-\") term)*\n\n term: factor ((\"*\" | \"/\" | \"//\" | \"%\" | \"@\") factor)*\n\n factor: (\"+\" | \"-\" | \"~\")* power\n\n\n atom: NAME\n | NUMBER\n | strings\n | \"True\" | \"False\" | \"None\" | \"...\"\n | \"(\" \")\" \n | \"(\" testlist \")\" \n | \"(\" expression \")\"\n | \"[\" [testlist] \"]\"\n | \"{\" \"}\" \n | \"{\" kvlist \"}\" // ONLY dict, no set\n\n // ===============\n // LITERALS & CALLS\n // ===============\n\n strings: STRING+\n\n kvlist: kvpair (\",\" kvpair)* [\",\"]\n\n kvpair: expression \":\" expression\n\n // ===============\n // PRIMARY-LIKE: attribute, call, subscript\n // ===============\n\n power: atom trailer* (\"**\" factor)?\n\n trailer: \"(\" [arglist] \")\"\n | \"[\" slices \"]\"\n | \".\" NAME\n\n slices: slice (\",\" slice)* [\",\"]\n\n slice: [expression] \":\" [expression] [\":\" [expression]]\n | expression\n\n arglist: argument (\",\" argument)* [\",\"]\n\n argument: expression\n | NAME \"=\" expression\n | \"**\" expression\n | \"*\" expression\n\n // ===============\n // LAMBDA\n // ===============\n\n lambdef: \"lambda\" [lambda_parameters] \":\" expression\n\n lambda_parameters: lambda_param (\",\" lambda_param)* [\",\"]\n\n lambda_param: NAME [\"=\" expression]\n\n // ===============\n // TARGETS (for assignment LHS)\n // ===============\n\n target: NAME\n | atom trailer+ // e.g., obj.attr, obj[0], obj()\n // 注意:严格来说 obj() 不能作为 target,但语法上可先允许,语义检查时拒绝\n\n // ===============\n // TERMINALS\n // ===============\n\n NAME: /[a-zA-Z_][a-zA-Z0-9_]*/\n STRING: /\"(?:[^\"\\\\]|\\\\.)*\"/\n | /'(?:[^'\\\\]|\\\\.)*'/\n NUMBER: /\\d+(\\.\\d+)?/\n\n %import common.WS_INLINE\n %ignore WS_INLINE\nask_user_config:\n enable: true\n\ntool_config:\n allowed_tools: [\"run_a_line_of_code\", \"submit_final_answer\"]\n translation:\n run_one_line_code: run_a_line_of_code\n submit_final_answer: submit_final_answer\n must_use_tool: true\n must_submit_a_dataframe: true \nformatter_config:\n list_limit: 8\n\nfrontend_summary: false\n\nprompt: |\n\n You are an expert Python Pandas data analyst working in an interactive Python environment.\n Your goal: Write precise Pandas code to answer user questions accurately and efficiently.\n\n ## AVAILABLE TOOLS\n\n 1. **run_a_line_of_code** - Execute one line of Python code\n Format: <e> reasoning for this code </e> <t> run_a_line_of_code </t> <p> code </p>\n You will see a sample output of the code execution. If you want to see more, use list slice (a[10:20]) or a listed generator with fuzzy search (a.loc[a['column'].str.contains('pattern', case=False, na=False)]).\n\n 2. **submit_final_answer** - Submit a DataFrame as the final answer\n Format: <e> why this answers the question </e> <t> submit_final_answer </t> <p> dataframe_name </p>\n\n ## SYSTEMATIC WORKFLOW\n\n ### Phase 1: Data Discovery (ALWAYS start here)\n 1. Examine DataFrame structure: df.columns\n 2. Preview data samples: df.head()\n\n ### Phase 2: Data Exploration (CRITICAL - Never skip)\n **⚠️ GOLDEN RULE: Never filter data without exploring it first!**\n \n Before ANY filtering:\n 1. **Check if column is in \"Column Value Descriptions\" section above** (if present)\n - If YES: Use the exact value from Descriptions (e.g., trans['type'] == 'PRIJEM')\n - If NO: Continue to step 2\n 2. **For unmapped columns**: Explore actual values first\n - Use fuzzy matching: df[df['column'].str.contains('pattern', case=False, na=False)]\n - Examine actual values: df['column'].unique()[:3]\n - Only then apply exact filters\n \n **Before performing any JOIN operations:**\n - First check the corresponding `_fk` DataFrame (e.g., `cards_fk` for `cards` table) to understand foreign key relationships\n - The `_fk` DataFrames show: which columns (`from`) reference which tables (`table`) and their target columns (`to`)\n \n Example workflow:\n # Scenario 1: Column with Descriptions\n # Task: Filter credit transactions\n # Step 1: Check \"Column Value Descriptions\" → trans.type: \"PRIJEM\"=credit ✓\n # Step 2: Use exact value directly\n <e>Filter credit transactions using mapped value</e>\n <t>run_a_line_of_code</t><p>credit_trans = trans[trans['type'] == 'PRIJEM']</p>\n \n # Scenario 2: Column without Descriptions\n # WRONG: df[df['name'] == 'Superman'] # Don't assume exact match\n # RIGHT: \n # Step 1: df['name'].str.contains('super', case=False).sum() # Check matches\n # Step 2: df[df['name'].str.contains('super', case=False)]['name'].unique() # See variants\n # Step 3: df[df['name'] == 'Superman'] # Now safe to filter exactly\n\n\n ### Phase 3: Solution Building\n - Build queries incrementally - test each component\n - Verify intermediate results make sense\n - Handle edge cases (nulls, data type mismatches)\n - If errors occur: analyze → understand → fix (don't guess)\n\n ### Phase 4: Result Validation\n Before submitting:\n - Verify row count is reasonable\n - Check all required columns are present\n - Remove irrelevant columns\n - Confirm the answer addresses the user's question\n\n ## BEST PRACTICES\n\n 1. **Think Before Acting**: Explain your reasoning before each code execution\n 2. **Incremental Progress**: Build complex queries step by step\n 3. **Defensive Coding**: Always handle potential edge cases\n 4. **Data Awareness**: Understand the data before manipulating it\n 5. **Clear Communication**: Explain findings and decisions clearly\n\n ## COMMON PITFALLS TO AVOID\n\n 1. Don't assume column names or values without checking\n 2. Don't use exact filters without exploring data first \n 3. Don't ignore data types (strings vs numbers)\n 4. Don't run overly complex one-liners instead of clear, tested code\n 5. Don't use print to see the output; use <t> run_a_line_of_code </t> <p> VARIABLE_NAME </p> to see it.\n \n ## REMEMBER\n - Always starts with <e>.\n - Libraries and DataFrames are pre-loaded\n - Execute one line at a time\n - Always validate results before proceeding\n - Quality over speed - accurate answers matter most\n - When you submit your final answer, remember to submit the columns that exactly required by the user's question: no thing more, no thing less.\n For example, if the user asks \"what is the attribute of a name?\", you should submit the dataframe with only the **attribute** column, **without** the name column.\n If the user asks \"who is the max of a attribute?\", you should submit the dataframe with only the **name** column, **without** the attribute column.\n\n Now, let's solve the user's question step by step with careful analysis and validation.\n\ninit_codes: []"}}, "_financial/pandasman_config.yaml": {"a29f56f77bda447bd1229fdc7b2b054764fc4546": {"t": 1785746847.3094969, "n": 11713, "h": "8753dce7e4e08111", "c": "db_name: _financial\nmax_conversation_turns: 200\nknowledge_base_config:\n enable: false\n mode: empty\nllm_client:\n api_type: openai\n #base_url: http://172.17.120.13/v1\n #api_key: transwarp\n base_url: https://api.deepseek.com\n api_key: sk-0bf7fd50de534419ab946a677aa346bf\n think_first_config:\n first_think_stop_with_p: true\nllm_inference:\n #model: qwen3-coder-30b-2\n model: deepseek-chat\n max_tokens: 3000\n temperature: 0.7\n seed: 42\n top_p: 0.8\n presence_penalty: 1.05\n stop:\n - </p>\n extra_body:\n guided_grammar: \"start: tool_use\\n\\ntool_use: \\\"<e>\\\" TEXT? \\\"</e>\\\" \\\"<t>\\\" TOOL_NAME \\\"</t>\\\" \\\"<p>\\\" simple_stmt \\\"</p>\\\"\\n\\nTOOL_NAME: \\\"run_a_line_of_code\\\" | \\\"submit_final_answer\\\"\\n\\nTEXT: /[^<`]+/\\n\\n// ===============\\n// SIMPLE STATEMENTS\\n// ===============\\n\\nsimple_stmt: assignment\\n | testlist\\n | import_stmt\\n\\nassignment: target \\\"=\\\" testlist\\n\\n// 增强赋值(可选,你原语法未用,但建议保留)\\naugassign: \\\"+=\\\" | \\\"-=\\\" | \\\"*=\\\" | \\\"@=\\\" | \\\"/=\\\" | \\\"%=\\\" | \\\"&=\\\" | \\\"|=\\\" | \\\"^=\\\" | \\\"<<=\\\" | \\\">>=\\\" | \\\"**=\\\" | \\\"//=\\\"\\n\\n// ===============\\n// IMPORTS\\n// ===============\\n\\nimport_stmt: import_name | import_from\\n\\nimport_name: \\\"import\\\" dotted_as_names\\n\\nimport_from: \\\"from\\\" dotted_name \\\"import\\\" import_from_targets\\n\\nimport_from_targets: \\\"(\\\" import_from_as_names [\\\",\\\"] \\\")\\\"\\n | import_from_as_names\\n | \\\"*\\\"\\n\\nimport_from_as_names: import_from_as_name (\\\",\\\" import_from_as_name)*\\n\\nimport_from_as_name: NAME\\n\\ndotted_as_names: dotted_as_name\\\n \\ (\\\",\\\" dotted_as_name)*\\n\\ndotted_as_name: dotted_name [\\\"as\\\" NAME]\\n\\ndotted_name: NAME (\\\".\\\" NAME)*\\n\\n// ===============\\n// EXPRESSIONS\\n// ===============\\n\\ntestlist: expression (\\\",\\\" expression)* [\\\",\\\"]\\n\\nexpression: disjunction (\\\"if\\\" disjunction \\\"else\\\" expression)?\\n | lambdef\\n\\ndisjunction: conjunction (\\\"or\\\" conjunction)*\\n\\nconjunction: inversion (\\\"and\\\" inversion)*\\n\\ninversion: \\\"not\\\" inversion\\n | comparison\\n\\ncomparison: bitwise_or (comp_op bitwise_or)*\\n\\ncomp_op: \\\"==\\\" | \\\"!=\\\" | \\\"<=\\\" | \\\"<\\\" | \\\">=\\\" | \\\">\\\"\\n | \\\"in\\\" | \\\"not\\\" \\\"in\\\"\\n | \\\"is\\\" [\\\"not\\\"]\\n\\nbitwise_or: bitwise_xor (\\\"|\\\" bitwise_xor)*\\n\\nbitwise_xor: bitwise_and (\\\"^\\\" bitwise_and)*\\n\\nbitwise_and: shift_expr (\\\"&\\\" shift_expr)*\\n\\nshift_expr: sum (\\\"<<\\\" sum | \\\">>\\\" sum)*\\n\\nsum: term ((\\\"+\\\" | \\\"-\\\") term)*\\n\\nterm: factor ((\\\"*\\\" | \\\"/\\\" | \\\"//\\\" | \\\"%\\\" | \\\"@\\\") factor)*\\n\\nfactor: (\\\"+\\\" | \\\"-\\\" | \\\"~\\\")* power\\n\\n\\natom: NAME\\n| NUMBER\\n| strings\\n|\\\n \\ \\\"True\\\" | \\\"False\\\" | \\\"None\\\" | \\\"...\\\"\\n| \\\"(\\\" \\\")\\\" \\n| \\\"(\\\" testlist \\\")\\\" \\n| \\\"(\\\" expression \\\")\\\"\\n| \\\"[\\\" [testlist] \\\"]\\\"\\n| \\\"{\\\" \\\"}\\\" \\n| \\\"{\\\" kvlist \\\"}\\\" // ONLY dict, no set\\n\\n// ===============\\n// LITERALS & CALLS\\n// ===============\\n\\nstrings: STRING+\\n\\nkvlist: kvpair (\\\",\\\" kvpair)* [\\\",\\\"]\\n\\nkvpair: expression \\\":\\\" expression\\n\\n// ===============\\n// PRIMARY-LIKE: attribute, call, subscript\\n// ===============\\n\\npower: atom trailer* (\\\"**\\\" factor)?\\n\\ntrailer: \\\"(\\\" [arglist] \\\")\\\"\\n | \\\"[\\\" slices \\\"]\\\"\\n | \\\".\\\" NAME\\n\\nslices: slice (\\\",\\\" slice)* [\\\",\\\"]\\n\\nslice: [expression] \\\":\\\" [expression] [\\\":\\\" [expression]]\\n| expression\\n\\narglist: argument (\\\",\\\" argument)* [\\\",\\\"]\\n\\nargument: expression\\n | NAME \\\"=\\\" expression\\n | \\\"**\\\" expression\\n | \\\"*\\\" expression\\n\\n// ===============\\n// LAMBDA\\n// ===============\\n\\nlambdef: \\\"lambda\\\" [lambda_parameters] \\\":\\\" expression\\n\\nlambda_parameters: lambda_param (\\\"\\\n ,\\\" lambda_param)* [\\\",\\\"]\\n\\nlambda_param: NAME [\\\"=\\\" expression]\\n\\n// ===============\\n// TARGETS (for assignment LHS)\\n// ===============\\n\\ntarget: NAME\\n | atom trailer+ // e.g., obj.attr, obj[0], obj()\\n // 注意:严格来说 obj() 不能作为 target,但语法上可先允许,语义检查时拒绝\\n\\n// ===============\\n// TERMINALS\\n// ===============\\n\\nNAME: /[a-zA-Z_][a-zA-Z0-9_]*/\\nSTRING: /\\\"(?:[^\\\"\\\\\\\\]|\\\\\\\\.)*\\\"/\\n | /'(?:[^'\\\\\\\\]|\\\\\\\\.)*'/\\nNUMBER: /\\\\d+(\\\\.\\\\d+)?/\\n\\n%import common.WS_INLINE\\n%ignore WS_INLINE\\n\"\nask_user_config:\n enable: true\ntool_config:\n allowed_tools:\n - run_a_line_of_code\n - submit_final_answer\n translation:\n run_one_line_code: run_a_line_of_code\n submit_final_answer: submit_final_answer\n must_use_tool: true\n must_submit_a_dataframe: true\nformatter_config:\n list_limit: 8\nfrontend_summary: false\nprompt: \"\\nYou are an expert Python Pandas data analyst working in an interactive Python environment.\\nYour goal: Write precise Pandas code to answer user questions accurately and efficiently.\\n\\n## AVAILABLE TOOLS\\n\\n1. **run_a_line_of_code** - Execute one line of Python code\\n Format: <e> reasoning for this code </e> <t> run_a_line_of_code </t> <p> code </p>\\n You will see a sample output of the code execution. If you want to see more, use list slice (a[10:20]) or a listed generator with fuzzy search (a.loc[a['column'].str.contains('pattern', case=False, na=False)]).\\n\\n2. **submit_final_answer** - Submit a DataFrame as the final answer\\n Format: <e> why this answers the question </e> <t> submit_final_answer </t> <p> dataframe_name </p>\\n\\n ## Column Value Descriptions\\n \\n **IMPORTANT**: The descriptions below show exact values for categorical/enumerated columns.\\n - Use these exact strings when filtering (e.g., trans['type'] == 'PRIJEM', NOT 'credit')\\n - When you\\\n \\ see non-English values in df.unique(), refer here for meanings\\n - These descriptions are pre-verified - trust them without additional exploration\\n \\n ### account\\n - frequency: \\\"POPLATEK MESICNE\\\"=monthly issuance, \\\"POPLATEK TYDNE\\\"=weekly issuance, \\\"POPLATEK PO OBRATU\\\"=issuance after transaction\\n - date (creation date of the account)\\n \\n ### card\\n - type (type of credit card): \\\"junior\\\"=junior class of credit card, \\\"classic\\\"=standard class of credit card, \\\"gold\\\"=high-level credit card\\n - issued (date when the credit card issued)\\n \\n ### client\\n - gender: F=female, M=male\\n \\n ### disp\\n - type (type of disposition): \\\"OWNER\\\", \\\"USER\\\", \\\"DISPONENT\\\"\\n \\n ### district\\n - A2 (district_name)\\n - A3 (region)\\n - A5 (municipality < district < region)\\n - A6 (municipality < district < region)\\n - A7 (municipality < district < region)\\n - A8 (municipality < district < region)\\n - A10 (ratio of urban\\\n \\ inhabitants)\\n - A11 (average salary)\\n - A12 (unemployment rate 1995)\\n - A13 (unemployment rate 1996)\\n - A14 (no. of entrepreneurs per 1000 inhabitants)\\n - A15 (no. of committed crimes 1995)\\n - A16 (no. of committed crimes 1996)\\n \\n ### loan\\n - date (date when the loan is approved)\\n - status: 'A'=contract finished, no problems, 'B'=contract finished, loan not paid, 'C'=running contract, OK so far, 'D'=running contract, client in debt\\n \\n ### order\\n - bank_to (bank of the recipient)\\n - account_to (account of the recipient)\\n - k_symbol (purpose of the payment): \\\"POJISTNE\\\"=insurance payment, \\\"SIPO\\\"=household payment, \\\"LEASING\\\"=leasing, \\\"UVER\\\"=loan payment\\n \\n ### trans\\n - date (date of transaction)\\n - type (+/- transaction): \\\"PRIJEM\\\"=credit, \\\"VYDAJ\\\"=withdrawal\\n - operation (mode of transaction): \\\"VYBER KARTOU\\\"=credit card withdrawal, \\\"VKLAD\\\"=credit in cash, \\\"PREVOD Z UCTU\\\"=collection from another\\\n \\ bank, \\\"VYBER\\\"=withdrawal in cash, \\\"PREVOD NA UCET\\\"=remittance to another bank\\n - balance (balance after transaction)\\n - k_symbol: \\\"POJISTNE\\\"=insurrance payment, \\\"SLUZBY\\\"=payment for statement, \\\"UROK\\\"=interest credited, \\\"SANKC. UROK\\\"=sanction interest if negative balance, \\\"SIPO\\\"=household, \\\"DUCHOD\\\"=old-age pension, \\\"UVER\\\"=loan payment\\n \\n\\n ## SYSTEMATIC WORKFLOW\\n\\n### Phase 1: Data Discovery (ALWAYS start here)\\n1. Examine DataFrame structure: df.columns\\n2. Preview data samples: df.head()\\n\\n### Phase 2: Data Exploration (CRITICAL - Never skip)\\n**⚠️ GOLDEN RULE: Never filter data without exploring it first!**\\n\\nBefore ANY filtering:\\n1. **Check if column is in \\\"Column Value Descriptions\\\" section above** (if present)\\n - If YES: Use the exact value from Descriptions (e.g., trans['type'] == 'PRIJEM')\\n - If NO: Continue to step 2\\n2. **For unmapped columns**: Explore actual values first\\n - Use fuzzy matching: df[df['column'].str.contains('pattern',\\\n \\ case=False, na=False)]\\n - Examine actual values: df['column'].unique()[:3]\\n - Only then apply exact filters\\n\\n**Before performing any JOIN operations:**\\n- First check the corresponding `_fk` DataFrame (e.g., `cards_fk` for `cards` table) to understand foreign key relationships\\n- The `_fk` DataFrames show: which columns (`from`) reference which tables (`table`) and their target columns (`to`)\\n\\nExample workflow:\\n# Scenario 1: Column with Descriptions\\n# Task: Filter credit transactions\\n# Step 1: Check \\\"Column Value Descriptions\\\" → trans.type: \\\"PRIJEM\\\"=credit ✓\\n# Step 2: Use exact value directly\\n<e>Filter credit transactions using mapped value</e>\\n<t>run_a_line_of_code</t><p>credit_trans = trans[trans['type'] == 'PRIJEM']</p>\\n\\n# Scenario 2: Column without Descriptions\\n# WRONG: df[df['name'] == 'Superman'] # Don't assume exact match\\n# RIGHT: \\n# Step 1: df['name'].str.contains('super', case=False).sum() # Check matches\\n# Step 2: df[df['name'].str.contains('super',\\\n \\ case=False)]['name'].unique() # See variants\\n# Step 3: df[df['name'] == 'Superman'] # Now safe to filter exactly\\n\\n\\n### Phase 3: Solution Building\\n- Build queries incrementally - test each component\\n- Verify intermediate results make sense\\n- Handle edge cases (nulls, data type mismatches)\\n- If errors occur: analyze → understand → fix (don't guess)\\n\\n### Phase 4: Result Validation\\nBefore submitting:\\n- Verify row count is reasonable\\n- Check all required columns are present\\n- Remove irrelevant columns\\n- Confirm the answer addresses the user's question\\n\\n## BEST PRACTICES\\n\\n1. **Think Before Acting**: Explain your reasoning before each code execution\\n2. **Incremental Progress**: Build complex queries step by step\\n3. **Defensive Coding**: Always handle potential edge cases\\n4. **Data Awareness**: Understand the data before manipulating it\\n5. **Clear Communication**: Explain findings and decisions clearly\\n\\n## COMMON PITFALLS TO AVOID\\n\\n1. Don't assume column names or\\\n \\ values without checking\\n2. Don't use exact filters without exploring data first \\n3. Don't ignore data types (strings vs numbers)\\n4. Don't run overly complex one-liners instead of clear, tested code\\n5. Don't use print to see the output; use <t> run_a_line_of_code </t> <p> VARIABLE_NAME </p> to see it.\\n\\n## REMEMBER\\n- Always starts with <e>.\\n- Libraries and DataFrames are pre-loaded\\n- Execute one line at a time\\n- Always validate results before proceeding\\n- Quality over speed - accurate answers matter most\\n- When you submit your final answer, remember to submit the columns that exactly required by the user's question: no thing more, no thing less.\\nFor example, if the user asks \\\"what is the attribute of a name?\\\", you should submit the dataframe with only the **attribute** column, **without** the name column.\\nIf the user asks \\\"who is the max of a attribute?\\\", you should submit the dataframe with only the **name** column, **without** the attribute column.\\n\\nNow, let's solve\\\n \\ the user's question step by step with careful analysis and validation.\\n\"\ninit_codes:\n- import pandas as pd\n- from database._financial.dataframes import account, card, client, disp, district, loan, order, trans, account_fk, card_fk, client_fk, disp_fk, district_fk, loan_fk, order_fk, trans_fk\n"}}}} |