Skip to content

Conversation

bryanC29
Copy link

@bryanC29 bryanC29 commented Aug 1, 2025

Fixed lookup get method from self.map[query] to self.lookup.get(query)

Review the Contributing Guidelines

Before submitting a pull request, verify it meets all requirements in the Contributing Guidelines.

Translations

See the Contributing Guidelines. Verify you've:

  • Tagged the language maintainer
  • Prefixed the title with a language code
    • Example: "ja: Fix ..."

Fix KeyError and incorrect type hint in Cache class of query_cache_snippets.py

#1094

Description

  • Replaced direct dictionary access self.lookup[query] with self.lookup.get(query) to prevent KeyError when the query key is missing in the cache.

  • Fixed all incorrect references to self.map by replacing them with the correctly defined self.lookup dictionary.

  • Added proper type hints and linked list pointer handling in Node and LinkedList classes for clarity and correctness.

  • Ensured the Cache class handles missing keys gracefully and correctly manages LRU eviction logic.

  • Corrected method signatures in Cache.set to align with usage in QueryApi.

Fixed lookup get method from `self.map[query]` to `self.lookup.get(query)`
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