refactor(scaffold): simplify full.py, fix dependency inversion - #477
Merged
Conversation
…inversion full.py: replace manual YAML generation with config dict + yaml_dumps() cmd_scout.py: unify 5 _scaffold_* via generate_full_scaffold() clean.py: move _suggest_dateformat to profile/raw.py (fix dependency inversion) Net: -367 lines, 72 tests passing.
… stub suggest_validation now returns all normalized columns (was capped at 5) propose read_mode: robust when profile has CSV parsing errors
…validation signatures
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.
Riepilogo
Refactoring del modulo scaffold per ridurre complessità e eliminare la dependency inversion
profile → scaffold.Cosa cambia
scaffold/full.py(332 → 247 righe, -26%)yml_lines.append()(stringhe) a config dict +yaml_dumps()_build_sources()e helper per ogni tipo fonte (ckan, sdmx, sparql, html, file)suggest_validation()esuggest_mart_sql()(prima inline o duplicati)cli/cmd_scout.py(861 → 662 righe, -23%)_scaffold_*unificate: SPARQL/SDMX da ~150 righe di YAML manuale a ~10 righe_profile_sample()helper riusabile_scaffold_minimal_ckan()e_fmt_years()duplicatoscaffold/clean.py(547 → 464 righe, -15%)_suggest_dateformat+_try_strptimespostati inprofile/raw.pyprofile/non importa più dascaffold/profile/raw.pysuggest_dateformat()localmente (prima importata dascaffold/clean)Test
test_scaffold_full.py)Numeri