Skip to content

Conversation

@prantogg
Copy link
Member

Summary

  • Add fuzzy matching suggestions when users mistype location names (e.g., wkls.us.ca.sanfran suggests "sanfrancisco")
  • Support suggestions at all chain levels: country, region, and city
  • Extract SQL queries to dedicated wkls/queries.py module for better maintainability

Features

  • City-level suggestions: Uses Levenshtein distance for fuzzy matching (e.g., sanfransanfrancisco)
  • Region-level suggestions: Bidirectional prefix matching (e.g., wkls.us.calica)
  • Country-level suggestions: Bidirectional prefix matching (e.g., wkls.uus, ua, ug)
  • Wildcard tip: Shows helpful syntax for wildcard searches (e.g., wkls.us.ca['%sanfran%'])

Changes

  • Add _get_suggestions() method to Wkl class for fuzzy matching
  • Add _build_error_hint() helper to DRY error message construction
  • Create wkls/queries.py with all SQL query templates
  • Add 12 new tests covering suggestion functionality

prantogg and others added 6 commits January 23, 2026 12:36
- Create wkls/queries.py with all SQL query templates
- Consolidate duplicate city suggestion queries using region_filter placeholder
- Add _build_error_hint() helper to DRY error message construction
- Update _get_suggestions() to use new consolidated queries
- Standardize error messages to use 'No results found' consistently
- Fix Wkl.__getitem__ to return ChainableDataFrame instead of Wkl
- Fix ChainableDataFrame.__getitem__ to continue chaining when _chain exists
- Add test for bracket access suggestions
@prantogg prantogg merged commit 9065ff2 into main Jan 26, 2026
6 checks passed
@prantogg prantogg deleted the pranav/add-suggestions branch January 26, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants