tdfs4ds.props_show¶
tdfs4ds.props_show
¶
Feature properties, the SHOW side (0.3.7.23): what the app, the export, the agent and the
documentation read of the properties a store declares (valid range, allowed values, meaning of a
NULL, sensitivity; see tdfs4ds.feature_props).
Everything here is opt-in and fail-open: declared() returns None unless the store has the
properties tables (feature_props.state.PRESENT is truthy, tested BEFORE any read) and at least
one declared row, so with nothing declared no statement is issued and every caller keeps its old
output byte for byte. The sentences come from the ONE renderer of the core package
(render_properties_text); the helpers below only select, compare and lay out.
_VALID_VALUE_RE
module-attribute
¶
_VALID_VALUE_RE = compile('\\b(valid|allowed|permitted|acceptable|legal|expected|possible|authori[sz]ed)\\s+(values?|range|ranges|domain|levels?|categor\\w+)\\b|\\b(range|domain)\\s+of\\s+(valid|allowed)\\b|\\bwhat\\s+(values?|range)\\b.*\\b(can|may|allowed|valid)\\b|\\bvaleurs?\\s+(valides?|autoris\\w+|permises?|possibles?|accept\\w+|attendues?)\\b|\\b(plage|intervalle|domaine)\\s+(de\\s+)?(valeurs?|validit\\w+)\\b|\\bplage\\s+valide\\b|\\bvaleurs?\\b.{0,25}\\b(valides?|autoris\\w+|permises?)\\b|\\bvaleurs?\\b.*\\b(peut|peuvent)\\s+prendre\\b|\\bwhat\\s+(values?)\\b.*\\b(take|takes|hold)\\b', I)
_SELECTION_RE
module-attribute
¶
_SELECTION_RE = compile('\\b(select|selecting|target|targeting|filter|filtering|segment|segmenting|exclude|excluding|choose|pick|rank|prioriti[sz]e|score|decide|eligible|eligibility|cibler|ciblage|s[ée]lectionn\\w+|filtrer|segmenter|exclure|choisir|prioris\\w+|[ée]ligib\\w+)\\b', I)
_CUSTOMER_RE
module-attribute
¶
_CUSTOMER_RE = compile('\\b(customers?|clients?|people|persons?|users?|individuals?|members?|patients?|prospects?|personnes?|utilisateurs?|membres?|assur[ée]s?|abonn[ée]s?)\\b', I)
_OUTLIER_ASK_RE
module-attribute
¶
_OUTLIER_ASK_RE = compile('\\b(outliers?|unusual|anomal\\w*|atypiques?|aberrant\\w*|abnormal|out\\s+of\\s+(?:range|bounds)|impossible|invalid|hors\\s+(?:de\\s+la\\s+)?(?:plage|bornes|limites)|invalides?|bounds?|bornes?|limites?|declared\\s+range|plage\\s+d[ée]clar[ée]e)\\b', I)
present
¶
True only when the store is known to hold declared properties. Never reads the database.
render
¶
The fixed sentences of a property row (the core renderer); "" when unavailable.
declared
¶
The declared properties, or None (nothing declared, tables absent, any failure).
No statement is issued unless present().
find
¶
The property row of a feature: exact (domain, entity, name), narrowed by what is given; a bare
name that matches rows of several entities / domains is None (never a guess).
numeric_bounds
¶
(min, max) as floats (None for a missing or non-numeric bound).
compact
¶
The short cell of the feature catalog: range / allowed values, NULL meaning, sensitive.
export_values
¶
The three export cells of a declared row ("" for a property with no rule).
named_features
¶
Rows of df whose feature name the question writes (whole word, accents and _ tolerant).
valid_values_request
¶
The property rows a "what is a valid value for X?" question is about, or None. Pure.
sensitive_selection
¶
Sensitive features a question names while asking to select / target / filter customers.
asks_for_outliers
¶
The question asks for outliers / unusual values / the declared bounds (the only time the declared range is used by the agent for values and charts).
range_violation_line
¶
One fixed line when the stored min / max of a feature (feature_extremes result) fall
outside the declared range: those values are data errors, not outliers. "" otherwise,
and without any read when nothing is declared. Called only when the question asks for outliers.
declared_range_of
¶
(min, max) declared for a feature (floats), None when none; no read unless present.
process_properties_context
¶
Prompt block with the declared properties of a process's features; "" when none (and no
read unless the store has declared properties).
column_text_with_properties
¶
column_text_with_properties(table_name: str, column_name: str, text: str, df: Optional[DataFrame]) -> str
The text indexed for a documented column: its description, then the declared properties when the column is a feature with a single declaration (a name shared by several declarations is left alone).