feat(backend): fetch disease symptoms and treatments from Supabase dy…#61
feat(backend): fetch disease symptoms and treatments from Supabase dy…#61Tirthpanchori wants to merge 1 commit into
Conversation
|
@Tirthpanchori is attempting to deploy a commit to the karan3431's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
🎉 Thanks for your contribution, @Tirthpanchori! Please make sure CI passes and the checklist in the PR template is complete. A maintainer will review this soon. — The AgroNavis team |
|
Warning Review limit reached
More reviews will be available in 48 minutes and 9 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
any issue? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Great idea to move this to the database, but you forgot to include the Supabase SQL migration script to seed the crop_diseases table! If we merge this now, the database will be empty and the feature will break. Please add the .sql migration file with the INSERT statements for the data you deleted from main.py |
|
Hi! The migration file already exists in the repo at I ran Could you double check if this migration file is present on your end? If |
Summary
Replaces hardcoded
DISEASE_SYMPTOMSandDISEASE_TREATMENTSdictionaries inmain.pywith dynamic Supabase queries against the existingcrop_diseasestable.Related Issue
Closes #49
Changes
DISEASE_SYMPTOMSandDISEASE_TREATMENTSdicts frommain.py_get_disease_data(class_name)helper that fetchessymptomsandtreatmentfrom thecrop_diseasestable byclass_key_get_symptoms()and_get_treatments()to use the new DB helper instead of dict lookupsGET /api/wiki/diseases/{disease_id}endpoint to query byclass_keyinstead ofid, with UUID fallbackTesting
supabase db resetto apply the existing20260603000000_crop_diseases_wiki.sqlmigrationcrop_diseasestable via Supabase Studiouvicorn, confirmedApplication startup completewith no errors_get_symptomsand_get_treatmentsresolve correctly via DB lookupChecklist
.envvalues are committed