fix: resolve key error by initializing target dictionary with _dict and converting response in frappe dict#101
Conversation
…nd converting response in frappe dict
Confidence Score: 4/5Both changes are narrowly scoped and address the reported KeyError; the main risk is the two-step serialisation in parser.py if the OpenAI SDK ever returns non-serialisable data. The transaction_parser/transaction_parser/ai_integration/parser.py — the JSON round-trip error path.
|
| Filename | Overview |
|---|---|
| transaction_parser/transaction_parser/ai_integration/parser.py | Adds a JSON round-trip (json.dumps → to_dict) to deeply convert the OpenAI response into frappe._dict objects; the split error-handling path is a minor concern. |
| transaction_parser/transaction_parser/utils/response_merger.py | Replaces bare {} with _dict() when initialising a new nested object slot, ensuring newly created sub-dicts are frappe._dict and consistent with the top-level response wrapping in init. |
Reviews (1): Last reviewed commit: "fix: resolve key error by initializing t..." | Re-trigger Greptile
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 31 minutes and 3 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR contains two targeted fixes for data handling in the transaction parser. The parser module now JSON round-trips API responses during conversion by adding a 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No description provided.