Pass complete financial data to LLM in financial dashboard example#300
Pass complete financial data to LLM in financial dashboard example#300hssqz wants to merge 1 commit into
Conversation
PedramNavid
left a comment
There was a problem hiding this comment.
Code Review: PR #300
Overall Assessment: Feedback Provided
Summary: This PR aims to fix the financial dashboard creation example to pass complete financial statement data to the LLM instead of only revenue data. The core fix is correct, but there are several items to consider before merging.
Issues to Address
1. Incomplete refactoring (High Priority)
Location: Cell 12, lines 288-294
The revenue_by_quarter extraction is still present and used in the prompt, even though complete data is now being passed via financial_data_2024.to_string(). This creates redundancy.
Recommendation: Either remove revenue_by_quarter entirely and update the prompt to reference the complete data, or add a comment explaining why both are needed.
2. Commented-out code should be removed
Location: Cell 12, line 289
# fs_data = financial_statements.to_dict("records")Commented-out code should not be committed. Please remove this line.
3. Extra blank line
Location: Cell 12, line 292
Two consecutive blank lines after financial_data_2024 assignment. Consider removing one to follow PEP 8 style.
4. Unrelated markdown formatting changes
Location: Cells 0 and 23
The PR converts single-line markdown strings to multi-line arrays, which is purely cosmetic and adds ~60 lines of noise to the diff. Consider reverting these changes or doing them in a separate formatting-only PR to keep this PR focused.
Suggestions
- Add explanatory comment about why complete data is being passed
- Consider
.to_markdown(index=False)instead of.to_string()for potentially better LLM comprehension
Positive Notes
- ✅ Core issue correctly identified and fix approach is sound
- ✅ Proper pandas column selection
- ✅ Clear prompt addition: "Here is the complete 2024 financial data for reference:"
- ✅ Added newline at EOF
🤖 Generated with Claude Code
There was a problem hiding this comment.
hi @hssqz thanks for the PR! Please review the comments above. There's a couple important ones. Also make sure to run ruff format and ruff check as a final check before submitting! Thanks again
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) This PR fixes the financial dashboard notebook by passing complete financial data to the LLM prompt and reformats notebook source cells to proper arrays. Analysis1. Core fix: Passing complete financial data to the prompt financial_data_2024 = financial_statements[['Category', 'Q1_2024', 'Q2_2024', 'Q3_2024', 'Q4_2024']]And includes 2. Notebook formatting — The markdown source cells are reformatted from single strings to proper arrays of strings, and a trailing newline is added. These are standard notebook formatting fixes. SummaryThe fix addresses a real gap where the LLM was missing full financial data context. Clean, targeted change. Assessment: approve |
Summary
Fixes the financial dashboard creation example in
02_skills_financial_applications.ipynb(cell-12) to pass completefinancial statement data to the LLM instead of only revenue data.
Problem
Currently, only revenue data is extracted and passed to the LLM prompt:
fs_datavariable is defined but never usedrevenue_by_quarteris extracted from the financial statementsbut doesn't provide actual values
using real values from the dataset
Changes
all categories (Revenue, Gross Profit, Operating Income, Net Income)
financial metrics
Impact
complete financial data to the LLM
estimates
Test Plan
financial categories
Related issue: #298