Conversation
Scope state lookups by country in get_state_id using a 3-step fallback (exact match, abbr+country, name+country). Add stateless country fallback in StateTable for countries without state subdivisions. Update state_name index to include country_id for multi-country uniqueness. Fixes #18
- Fix COLLATE NOCASE placement on both indexes (apply to abbr/name columns, not country_id) - Add nil guard for country_id in StateTable#write - Add nil guard for state_id in ZipcodeTable#write - Strengthen fallback tests to verify correct state ID returned - Add test for nil country input to get_state_id - Add test verifying row mutation for downstream Kiba destinations
Fix state_abbr not globally unique across countries
…ve test coverage - Add warn/verbose logging to eliminate silent data loss cascade: country_table, state_table, county_table, and zipcode_table now log when rows are skipped due to missing lookups - Add warn_once helper to DbTable for deduplicated warnings - Narrow rescue SQLite3::ConstraintException to only swallow UNIQUE violations; re-raise NOT NULL, FOREIGN KEY, and CHECK violations - Extract find_state_where helper to keep get_state_id under method length limit - Add early return for nil/empty country in get_state_id - Expand synthesize_state comment to document Kiba row-hash mutation - Add missing tests: zipcode state_id nil guard, state country_id nil guard, and cross-country integration tests through full Kiba pipeline - Silence logger and initialize Options in spec_helper for all tests
Replace references to old rake tasks with the unified free_zipcode_data executable and update Ruby version to 3.4+.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rake speclocally and ALL specs passRelated Issue: #
Description: <please-add-a-comprehensive-description-of-fix/feature>