Skip to content

Apply channels.filters at read time (#103) - #104

Open
tombonfert wants to merge 4 commits into
mainfrom
feature/channel_table_filters
Open

tombonfert wants to merge 4 commits into
mainfrom
feature/channel_table_filters

Conversation

@tombonfert

@tombonfert tombonfert commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

SolverConfig.channels accepted a filters dict but the engine never applied it, so channel-table filters were silently dropped. This wires them up and adds a guardrail against the one way the feature can be misused.

Changes

  • Apply channels.filters in DefaultSolver._prepare_channels_join, after column_name_mapping and before the UDF-column projection, using the same equality-filter mechanism as container_tags, container_metrics, and channel_mapping. Applying it before the projection lets a filter reference any channels column, including dimension columns the solve step drops.
  • Reject implausibility-via-filter in RAW mode. A new config validator raises when data_type = RAW and channels.filters targets is_plausible. Such a filter runs before raw encoding and would bridge intervals across dropped samples; drop_implausible_data is the correct tool (it drops inside the encoder, so boundaries stay correct). The check keys off the internal is_plausible name, so it also catches a physical column mapped to it.
  • Docs. Documented channels-table filter support, noted that filter values are coerced to the target column type (booleans take "true"/"false"), added the previously undocumented is_plausible and timestamp internal names to the mapping table, and added a RAW-mode caveat. Also corrected a stale "RAW to RLE" error string to "RAW to interval" (the drop works for both raw encoders).
  • Solves Apply solver_config.channels.filters when reading the channels table #103

Test Plan

  • Unit tests added/updated
  • Manual testing completed
  • Documentation updated (if applicable)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No new linter warnings introduced

Wire per-table equality filters into `_prepare_channels_join` so the channels table is filtered after `column_name_mapping` and before the UDF-column projection. Update configuration docs to list `channels` as a filters-supported table and clarify filter value coercion. Add end-to-end unit tests covering string, non-matching, and boolean channel filters.
Add a QueryEngine validator that blocks `channels.filters` entries targeting the `is_plausible` column when `data_type=RAW`, since those filters run before raw encoding and bridge intervals across dropped implausible samples. Direct users to `drop_implausible_data=True` instead. Update configuration docs with the new internal columns and a caution callout. Add unit tests covering mapped plausibility columns, non-plausibility filters, and RLE mode.
@tombonfert
tombonfert requested a review from a team as a code owner September 18, 2026 15:09
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.80%. Comparing base (88af4a7) to head (8196245).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #104      +/-   ##
==========================================
+ Coverage   89.78%   89.80%   +0.01%     
==========================================
  Files          62       62              
  Lines        5717     5726       +9     
  Branches      716      719       +3     
==========================================
+ Hits         5133     5142       +9     
  Misses        463      463              
  Partials      121      121              
Flag Coverage Δ
query_engine 86.12% <100.00%> (+<0.01%) ⬆️
reporting 94.67% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ery_engine/analyze/query/solvers/default_solver.py 94.86% <100.00%> (+0.02%) ⬆️
src/impulse_reporting/config/config_parser.py 97.46% <100.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant