tdfs4ds.process_store.process_settings¶
tdfs4ds.process_store.process_settings
¶
Per-process settings: FS_PROCESS_SETTINGS (0.3.3.30).
A key/value valid-time table, PRIMARY INDEX (PROCESS_ID), for the options of a
process that change how run() executes it and that are not in FS_PROCESS_OPTIONS.
The first one is TRACK_ENTITY_REFRESH (see feature_store/entity_refresh.py).
Why a second table, and why key/value:
FS_PROCESS_OPTIONSis written by older clients with a column-less positionalELSE INSERT INTO ... ('pid', 'flag'): adding a column to it would make every older client'sclose_absent_entities=Truefail with Error 3812 (theFS_FOLLOW_UPlesson). It stays exactly as it is, andread_process_optionsmerges both tables.- A later option is a new
SETTING_NAME, not a new column: no DDL, ever. Every INSERT here names its columns.
The table is optional, like FS_PROCESS_OPTIONS: created at setup() and by
connect() when missing; a failed CREATE is one warning, remembered and not retried in
this process. A missing table or row reads as "every setting at its default".
sql_literal
¶
Escape value for use inside a single-quoted SQL string literal.
For the DBC probes and catalog predicates that compare a name as data
(WHERE DatabaseName = '…'). The caller supplies the surrounding quotes.
read_dataset_view
¶
(dataset_view_name, grouped) recorded for process_id, or None. Fail-open.
read_varchar_length
¶
The VARCHAR rounding of process_id: the recorded value, None when it records exact
lengths, DEFAULT_VARCHAR_LENGTH when nothing is recorded (a process registered before
0.3.5.1 by upload_features, whose default was 1024). Fail-open to the default.
varchar_length_value
¶
The text recorded for a force_varchar_length argument.
reset_state
¶
Forget what was learnt about the table (tests, setup(), connect()).
process_settings_creation
¶
Create FS_PROCESS_SETTINGS when missing. Never raises.
existing is the lower-cased object set connect() read from DBC: a table found
there costs no CREATE. Returns whether the table is usable.
available
¶
Whether FS_PROCESS_SETTINGS exists in the primary store (checked once per store).
upsert_setting_sql
¶
Record (or change) one setting. Every column is named.
switch_off_sql
¶
Set an existing setting to 'N'; a no-op when the process has no row.
read_settings
¶
{SETTING_NAME: SETTING_VALUE} of process_id. Fail-open: no table, no row or an
unreadable table is an empty dict (every setting at its default).
record_setting
¶
Record one setting (True / False are stored as Y / N).
A truthy flag writes the row (creating the table when it is missing, raising
RuntimeError when it cannot be). False only switches off an existing row and is
skipped when the table does not exist, so a store that never uses a setting gets no row.