refactor: replace hand-rolled columnar helpers with mloda's public ones - #88
Merged
TomKaltofen merged 1 commit intoJul 13, 2026
Merged
Conversation
mloda 0.10.0 ships columnar_to_rows and homogenize_rows in python_dict_utils, so the local rag_integration/feature_groups/columnar.py (added for the 0.9.0 bump when no public inverse of rows_to_columnar existed) is retired. All imports, including demo.ipynb, now point at the mloda helpers. mloda's columnar_to_rows is strict: it raises ValueError on any non-columnar-dict input instead of passing lists through or mapping None/str to []. Call sites fed by the PythonDict framework are unaffected (they always receive a columnar dict). flatten_result keeps the tolerant shape dispatch locally and only hands genuine columnar dicts to the strict helper; a new tests/integration/test_helpers.py pins that dispatch. Unit tests that handed calculate_feature row-wise lists now build the columnar shape the framework actually delivers (via rows_to_columnar + homogenize_rows for heterogeneous rows). calculate_feature overrides that claimed data: List[Dict[str, Any]] are widened to data: Any, matching the runtime contract and the remaining overrides in the repo. Closes mloda-ai#82
This was referenced Jul 13, 2026
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.
Closes #82.
mloda 0.10.0 ships
columnar_to_rowsandhomogenize_rowsinpython_dict_utils, so the localrag_integration/feature_groups/columnar.py(added in #81 when 0.9.0 had no public inverse ofrows_to_columnar) is retired. All 27 importing files, plusdemo.ipynb, now use the mloda helpers.Strictness change
mloda's
columnar_to_rowsraisesValueErroron any non-columnar-dict input, where the local helper passed lists through and mappedNone/strto[]. Per call site:[], which is the better failure mode.tests/integration/helpers.py::flatten_result: keeps its tolerant shape dispatch locally (row-wise passthrough, empty fallback) and only hands genuine columnar dicts to the strict helper. Behavior is preserved branch by branch; the newtests/integration/test_helpers.pypins that dispatch.tests/feature_groups/test_columnar.py: retired with the module; the pivot semantics are pinned upstream in mloda.Test and annotation cleanup
Unit tests that handed
calculate_featurerow-wise lists (dedup base, both retrieval evaluators, graph source chaining) now build the columnar shape the framework actually delivers, viarows_to_columnar+homogenize_rowswhere rows are heterogeneous.calculate_featureoverrides annotateddata: List[Dict[str, Any]]are widened todata: Any, matching the runtime contract and the other overrides in the repo.Verification
toxgreen (707 tests, ruff format, ruff check, mypy --strict, bandit).demo.ipynbimport; dedup test name clarified). No correctness findings.