recon_gen.common.sql.app2_filters
Date-range pushdown helper for the universal L1 + Exec date pickers.
Phase BM replaced the pre-BM dual-SQL {date_filter} template +
app2_date_filter() snippet with the unified
<<$pXxxDateStart>> / <<$pXxxDateEnd>> dataset-parameter
pushdown shape used elsewhere in Phase Y. One SQL form across QS +
App2; the renderer-specific bind machinery dissolved. This module
now exposes a single helper that emits the day-inclusive predicate
fragment per dialect.
Pre-BM history (preserved for context): the file previously held the
app2_date_filter helper that emitted dialect-specific
:date_from / :date_to bind clauses for App2 while QS got an
empty substitution + an analysis-level TimeRangeFilter FG. The
dual-form caused the day-edge quirk (QS’s TimeRangeFilter included
the upper-bound day’s late-day rows differently from App2’s
< date_to + 1 day shape) plus the visual_identifier= test
dance documented in BL.2.B. Both artifacts dissolved with BM.
Functions
|
Phase BM — day-inclusive range pushdown via QS dataset parameters. |
- recon_gen.common.sql.app2_filters.universal_date_range_clause(date_column, *, start_param, end_param, dialect)[source]
Phase BM — day-inclusive range pushdown via QS dataset parameters.
Returns an unprefixed predicate fragment narrowing
date_columnby twoDateTimeDatasetParameter``s named ``start_param/end_param. Used by L1 + Exec date-scoped datasets in place of the pre-BM dual-SQL{date_filter}slot.The substituted parameter value arrives as an ISO datetime string (
'2026-05-20T00:00:00') on both renderers — QS substitutes<<$pX>>literally, App2 binds via:param_pX. The clause uses dialect-portable casts so that string parses to a DATE / TIMESTAMP on every backend.Day-inclusive on both ends: the upper bound expands to “just before midnight on the day AFTER end_param” so TIMESTAMP-shaped columns (
posting) include same-day non-midnight rows. The lower bound is the natural>= start_param(midnight, inclusive).No
ANDprefix — caller composes viaWHERE ... AND <clause>explicitly.- Return type:
str- Parameters:
date_column (str)
start_param (str)
end_param (str)
dialect (Dialect)