Feature/custom solver support - #68
Open
adefabian wants to merge 12 commits into
Open
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
Fixes the lint failure on the PR: black wanted the DefaultSolver solve call wrapped after the helper rename pushed the line over the limit. Co-authored-by: Isaac
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), treats re-registering the same class as idempotent, rejects conflicting duplicates, and lists the known nameswhen 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 alsowire spark and the raw-data flags. The report factory builds any solver the same way, whatever its constructor looks like.
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 areenforced at parse time and an unregistered name fails early as a
ValidationError.core/report.py):create_solverresolves the name through the registry and callsfrom_config(ctx)instead of a hardcodedmatch. Solver telemetry now logs the registered name string rather than an enum member.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 — plus a worked column-redaction example.skills/impulse-config,skills/impulse-data-model): updated to describe selecting a solver by registered name.Customer solvers extend behavior by overriding the supported
QuerySolverpipeline methods (e.g.
solve); the report factory and incrementalchange-detection paths are unchanged and continue to read silver data through
MeasurementDB.Test Plan
registry_test.py),from_confighook (from_config_test.py), config/solver-selection validation (solver_registry_config_test.py)custom_solver_report_test.py) and an end-to-end custom-solver solve (custom_solver_test.py)Checklist