feat: move data normalization from Python consumers to Rust extractor (#290)#294
Merged
SimplicityGuy merged 13 commits intomainfrom Apr 12, 2026
Merged
feat: move data normalization from Python consumers to Rust extractor (#290)#294SimplicityGuy merged 13 commits intomainfrom
SimplicityGuy merged 13 commits intomainfrom
Conversation
…290) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…290) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add strip_at_prefixes, unwrap_container, and ensure_list functions for transforming XML-style JSON conventions into flat format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add normalize_item_list helper and normalize_artist function to flatten members, groups, and aliases from XML container format to flat arrays. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add normalize_label function to handle parentLabel strip_at_prefixes and sublabels container flattening. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add normalize_string_list helper and normalize_master function to handle @id stripping, artists container, genres, and styles flattening. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add normalize_release function handling artists, labels, master_id extraction, genres, styles, extraartists, and formats with @-prefix stripping. Includes full pipeline integration test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… to Rust extractor - Gut data_normalizer.py to only retain year parsing and normalize_record() - Replace extract_format_names with inline list comprehension in graphinator - Rewrite normalizer tests for simplified module - Update all test fixtures to flat extractor output format Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…le path resolution Rules use dot-notation paths like "genres.genre" that match the XML structure. Moving normalize_record after evaluate_rules ensures rules operate on the pre-normalized shape while the content hash still reflects the normalized output consumers see. Also updates stale comment in tableinator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ze.rs Covers: non-object inputs to normalizers, string/number items in normalize_item_list, bare string in unwrap_container, non-object format items. Raises line coverage from 93.4% to 97.7%. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Contributor
Contributor
Contributor
Contributor
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.
Summary
normalize.rsmodule to the Rust extractor that transforms XML-shaped JSON (@id,#text, nested containers) into flat, consumer-ready JSON — normalization now runs once at extraction time instead of redundantly in every consumercommon/data_normalizer.pyfrom ~475 lines to ~65 lines — only_parse_year_int()and a thinnormalize_record()wrapper remainextract_format_names()from graphinator, replaced with inline list comprehension on the already-flatformatsarrayparse → filters → rules → normalize → hash → publish— rules still operate on XML-shaped data, hash reflects normalized outputTest plan
normalize_tests.rscovering all entity types and edge casesCloses #290
🤖 Generated with Claude Code