Skip to content

Conversation

@prantogg
Copy link
Member

@prantogg prantogg commented Jan 23, 2026

Cleans up core.py by removing duplicated code and adding a simple performance optimization.

Changes:

  • Dynamic method delegation - ChainableDataFrame now delegates to Wkl via __getattr__ instead of 11 separate wrapper methods
  • Cache _has_region checks - Store results in a module-level dict to avoid repeated SQL queries for the same country
  • Extract helper methods - _get_subdivisions() for counties/cities
  • Simplify conditionals - Remove redundant branches in regions(), counties(), cities()

@prantogg prantogg requested a review from mpetazzoni January 23, 2026 02:15
@prantogg prantogg merged commit 95b57bb into main Jan 23, 2026
6 checks passed
@prantogg prantogg deleted the pranav/code-cleanup branch January 23, 2026 16:59
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