Feature/custom solver support - #68
Draft
adefabian wants to merge 10 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
==========================================
+ Coverage 88.69% 88.89% +0.20%
==========================================
Files 60 62 +2
Lines 5015 5081 +66
Branches 598 602 +4
==========================================
+ Hits 4448 4517 +69
+ Misses 461 459 -2
+ Partials 106 105 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
adefabian
force-pushed
the
feature/custom_solver_support
branch
from
August 10, 2026 17:26
1a4a741 to
c0b01a0
Compare
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
Customers can now ship their own
QuerySolver(say, one that reshapes their rawtables into the Impulse silver schema) without touching Impulse core.
Solvers register themselves by name, the report config picks one by that name through the
existing
query_engine.solverfield, and each solver can bring its ownSolverConfigsubclass whose extra fields get checked at parse time.Config picks a solver by registered name, not by class path. So a config can't
make Impulse import and run some arbitrary class. What solvers exist depends
entirely on what the driver imports.
DefaultSolvermoves onto this mechanism with no behavior change. It registersunder
"DefaultSolver"(plus the old"DeltaSolver"/"KeyValueStoreSolver"aliases), so existing configs keep working.
Changes
solvers/registry.py):@register_solver(name, config_cls, *, aliases, overwrite)plusresolve_registration/is_registered/registered_names. Maps a name to(solver_cls, config_cls), rejects conflicting duplicates, and lists the known names when a lookup misses.QuerySolver.from_config+solvers/solver_context.py): a frozenSolverBuildContext(spark,solver_config,is_raw_data,drop_implausible_data,raw_encoder) is the one place construction inputs live. Basefrom_configpasses justsolver_config;DefaultSolveroverrides it to also wire spark and the raw-data flags. The report factory builds any solver the same way, whatever its constructor looks like.QuerySolver:load_container_tags,load_container_metrics,load_channel_tags,load_channel_metrics,load_channel_mapping,load_unit_conversion,load_channels. Defaults read the single configured table (same as before); a custom solver overrides them to combine or reshape raw sources.DefaultSolver's reads now go through these seams.config_parser.py):query_engine.solveris a plainstrnow (any registered name).Solversbecomes aStrEnumso old== Solvers.DEFAULT_SOLVERcomparisons still hold. Amode="before"validator re-validatessolver_configthrough the selected solver'sconfig_cls, so a custom solver's fields are enforced at parse time and an unregistered name fails early as aValidationError.core/report.py):create_solverresolves the name through the registry and callsfrom_config(ctx)instead of a hardcodedmatch. Incremental change detection reads containers viasolver.load_container_metrics(...), so a reshaping solver feeds the same container set into upsert detection.docs/impulse/docs/data_model/ingestion.md): a "Registering a custom solver" section covering subclassingDefaultSolver, declaring aSolverConfigsubclass, selecting it by name, and importing the package so registration runs.Test Plan
Checklist