Skip to content

Optimize MLA lookup and fix tests#17

Closed
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
fix-and-optimize-mla-lookup-3080651485260252964
Closed

Optimize MLA lookup and fix tests#17
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
fix-and-optimize-mla-lookup-3080651485260252964

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This PR addresses performance and correctness issues in the MLA lookup and AI summary features.

  1. Performance:

    • Converted linear search in maharashtra_locator.py to O(1) dictionary lookups.
    • Implemented a simple in-memory cache for generate_mla_summary to avoid hitting the Gemini API for repeated requests for the same MLA.
  2. Correctness:

    • Fixed tests/test_mh_endpoint.py which was asserting against placeholder data ("Sample MLA") while the actual JSON data contained real names ("Ravindra Dhangekar").
  3. Maintenance:

    • Suppressed the deprecation warning for google.generativeai.

PR created automatically by Jules for task 3080651485260252964 started by @RohanExploit

- Refactored `backend/maharashtra_locator.py` to use dictionaries for O(1) lookups instead of list iteration.
- Added in-memory caching to `backend/gemini_summary.py` to reduce redundant AI API calls.
- Updated `tests/test_mh_endpoint.py` to match real-world data in the JSON files.
- Suppressed `FutureWarning` from `google.generativeai` package.
- Updated `tests/test_maharashtra_locator.py` to verify dictionary data structures.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@netlify

netlify Bot commented Dec 24, 2025

Copy link
Copy Markdown

Deploy Preview for fixmybharat canceled.

Name Link
🔨 Latest commit 1584730
🔍 Latest deploy log https://app.netlify.com/projects/fixmybharat/deploys/6a2e3ce5989c3300084e869d

@RohanExploit RohanExploit added ECWoC26 Elite Coders winter of Code and removed ECWoC26 Elite Coders winter of Code labels Jan 14, 2026
@RohanExploit RohanExploit temporarily deployed to fix-and-optimize-mla-lookup-3080651485260252964 - vishwaguru-backend PR #17 June 14, 2026 05:32 — with Render Destroyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant