recon_gen.common.tree.controls
Typed Filter + Parameter control wrappers (L.1.9).
Each control binds to a typed source by object reference: parameter
controls take a ParameterDeclLike (the parameter declaration node
they read/write); filter controls take a FilterLike (the inner
filter their UI drives). At emit time the wrapper reads
parameter.name or filter.filter_id to populate the underlying
models.SourceParameterName / SourceFilterId.
Naming convention: same as L.1.6 — tree wrappers use a clean,
unsuffixed name that doesn’t collide with the underlying
models.*Control classes (Parameter*Control, Filter*Control).
User code reads:
- from recon_gen.common.tree import (
ParameterDropdown, ParameterSlider, FilterDropdown, …,
)
LinkedValues / StaticValues typed wrappers replace the
existing dict-shaped SelectableValues argument — LinkedValues
takes a typed Dataset ref + column name (catches “dropdown
populated from undeclared dataset” via the App’s dependency graph
walk).
Auto-IDs (L.1.8.5 extension): control_id fields are Optional;
the App walker assigns position-indexed IDs at emit time
(pc-{kind}-s{sheet_idx}-{control_idx} for parameter controls,
fc-{kind}-s{sheet_idx}-{control_idx} for filter controls).
Classes
|
Tree-level filter control nodes. |
|
Cross-sheet filter control — surfaces the filter on multiple sheets via the same bound filter. |
|
Date/time picker control bound to a TimeRangeFilter. |
|
Dropdown control bound to an inner filter ( |
|
Slider control bound to a NumericRangeFilter. |
|
Auto-populate the dropdown's options from a dataset column. |
|
Tree-level parameter control nodes. |
|
Date/time picker control bound to a DateTime parameter. |
|
Dropdown control bound to a |
|
Slider control bound to a numeric parameter. |
|
Free-text input control bound to a string parameter. |
|
Restrict the dropdown to a fixed list of options. |
- class recon_gen.common.tree.controls.FilterControlLike(*args, **kwargs)[source]
Bases:
ProtocolTree-level filter control nodes.
datasets()participates in the L.1.7 dependency-graph walk — same shape asParameterControlLike.datasets().- control_id: str | Literal[_AutoSentinel.AUTO]
- class recon_gen.common.tree.controls.FilterCrossSheet(filter, control_id=AUTO)[source]
Bases:
objectCross-sheet filter control — surfaces the filter on multiple sheets via the same bound filter.
No title; the Cross-Sheet control inherits its UI from the underlying filter’s primary control.
- Parameters:
filter (FilterLike)
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- filter: FilterLike
- class recon_gen.common.tree.controls.FilterDateTimePicker(filter, title, type='DATE_RANGE', control_id=AUTO)[source]
Bases:
objectDate/time picker control bound to a TimeRangeFilter.
- Parameters:
filter (FilterLike)
title (str)
type (Literal['SINGLE_VALUED', 'DATE_RANGE'])
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- filter: FilterLike
- title: str
- type: Literal['SINGLE_VALUED', 'DATE_RANGE'] = 'DATE_RANGE'
- class recon_gen.common.tree.controls.FilterDropdown(filter, title, type='MULTI_SELECT', selectable_values=None, control_id=AUTO)[source]
Bases:
objectDropdown control bound to an inner filter (
CategoryFilter).filteris the typed inner filter the dropdown drives — at emit time, the control’sSourceFilterIdbecomesfilter.filter_id. The filter must be inside aFilterGroupthat’s been registered on the analysis.- Parameters:
filter (FilterLike)
title (str)
type (Literal['SINGLE_SELECT', 'MULTI_SELECT'])
selectable_values (StaticValues | LinkedValues | None)
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- filter: FilterLike
- selectable_values: StaticValues | LinkedValues | None = None
- title: str
- type: Literal['SINGLE_SELECT', 'MULTI_SELECT'] = 'MULTI_SELECT'
- class recon_gen.common.tree.controls.FilterSlider(filter, title, minimum_value, maximum_value, step_size, type='RANGE', control_id=AUTO)[source]
Bases:
objectSlider control bound to a NumericRangeFilter.
- Parameters:
filter (FilterLike)
title (str)
minimum_value (float)
maximum_value (float)
step_size (float)
type (Literal['SINGLE_POINT', 'RANGE'])
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- filter: FilterLike
- maximum_value: float
- minimum_value: float
- step_size: float
- title: str
- type: Literal['SINGLE_POINT', 'RANGE'] = 'RANGE'
- class recon_gen.common.tree.controls.LinkedValues(dataset, column_name)[source]
Bases:
objectAuto-populate the dropdown’s options from a dataset column.
Construct via the factory methods (L.1.22 — the canonical fields are
dataset+column_name; the factories normalize the two legitimate construction forms into that pair, eliminating the dual-form__post_init__validation):LinkedValues.from_column(ds["col"])— typed Column form. The Column carries its own dataset, so the factory derivesdatasetfrom the Column. Preferred — the contract validates the column name at the wiring site.LinkedValues.from_string(dataset=ds, column_name="col")— bare-string escape hatch for datasets without a registeredDatasetContract. Dataset must be passed explicitly.
The Dataset participates in the L.1.7 dependency-graph walk via the control’s
datasets()method.- Parameters:
dataset (Dataset)
column_name (str)
- column_name: str
- classmethod from_column(column)[source]
Linked values pulled from a typed Column. The Column’s dataset is the source dataset.
- Return type:
- Parameters:
column (Column)
- class recon_gen.common.tree.controls.ParameterControlLike(*args, **kwargs)[source]
Bases:
ProtocolTree-level parameter control nodes.
datasets()participates in the L.1.7 dependency-graph walk — controls withLinkedValuespopulate from aDataset, and that’s a dep. Controls with static values return an empty set.- control_id: str | Literal[_AutoSentinel.AUTO]
- class recon_gen.common.tree.controls.ParameterDateTimePicker(parameter, title, control_id=AUTO)[source]
Bases:
objectDate/time picker control bound to a DateTime parameter.
- Parameters:
parameter (ParameterDeclLike)
title (str)
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- parameter: ParameterDeclLike
- title: str
- class recon_gen.common.tree.controls.ParameterDropdown(parameter, title, selectable_values, type='SINGLE_SELECT', hidden_select_all=False, cascade_source=None, cascade_match_column=None, control_id=AUTO)[source]
Bases:
objectDropdown control bound to a
ParameterDeclLikeparameter.parameteris the typed parameter declaration the control reads/writes — at emit time, the control’sSourceParameterNamebecomesparameter.name. The type checker catches “control bound to a parameter that doesn’t exist” at the wiring site.selectable_valuesaccepts aStaticValues(["a", "b"])for a fixed option list orLinkedValues(dataset, column)for an auto-populated list. TheLinkedValues.datasetref participates in the App’s dependency graph.hidden_select_all=Truesuppresses the “Select all” entry — needed for SINGLE_SELECT dropdowns where empty/All semantics don’t apply (e.g. a Sankey anchor that needs exactly one value).cascade_sourcemakes this dropdown depend on another dropdown: whencascade_sourcechanges value, QS refreshes THIS dropdown’s options. Required for cascading filters even when the source dataset’s params are bridged viaMappedDataSetParameters— QS won’t refresh the dropdown widget without explicit UI-level cascade wiring (M.3.10c finding).- Parameters:
parameter (ParameterDeclLike)
title (str)
selectable_values (StaticValues | LinkedValues)
type (Literal['SINGLE_SELECT', 'MULTI_SELECT'])
hidden_select_all (bool)
cascade_source (ParameterDropdown | None)
cascade_match_column (Column | None)
control_id (str | Literal[_AutoSentinel.AUTO])
- cascade_source: ParameterDropdown | None = None
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- datasets()[source]
Datasets this control references (via LinkedValues if any).
- Return type:
set[Dataset]
- parameter: ParameterDeclLike
- selectable_values: StaticValues | LinkedValues
- title: str
- type: Literal['SINGLE_SELECT', 'MULTI_SELECT'] = 'SINGLE_SELECT'
- class recon_gen.common.tree.controls.ParameterSlider(parameter, title, minimum_value, maximum_value, step_size, control_id=AUTO)[source]
Bases:
objectSlider control bound to a numeric parameter.
- Parameters:
parameter (ParameterDeclLike)
title (str)
minimum_value (float)
maximum_value (float)
step_size (float)
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- maximum_value: float
- minimum_value: float
- parameter: ParameterDeclLike
- step_size: float
- title: str
- class recon_gen.common.tree.controls.ParameterTextField(parameter, title, control_id=AUTO)[source]
Bases:
objectFree-text input control bound to a string parameter.
Right shape when the parameter’s option universe is unbounded / unknown at deploy time, or when the LinkedValues / StaticValues paths are unavailable. The analyst types a value; QS writes it to the bound parameter verbatim. No sample-values fetch — sidesteps the X.1.b
Sample values not foundfailure mode entirely.Y.1.m: rejects
parameter.multi_valued=Trueat construction. QS text-field controls cannot commit non-empty values into a multi-valued parameter — the commit silently reverts both this parameter AND any sibling parameters back to their analysis-level defaults. Empty-string commits work (special case); any other string trips the state-reset bug. Reproduced live against L2FT Rails on 2026-05-06 — the metadata cascade was 100% broken in production for this reason. Construction-time error here prevents the whole class of regression at the wiring site.- Parameters:
parameter (ParameterDeclLike)
title (str)
control_id (str | Literal[_AutoSentinel.AUTO])
- control_id: str | Literal[_AutoSentinel.AUTO] = 'auto'
- parameter: ParameterDeclLike
- title: str