tdfs4ds.process_store.process_options¶
tdfs4ds.process_store.process_options
¶
Per-process execution options: FS_PROCESS_OPTIONS (0.3.3.22).
One valid-time row per process, PRIMARY INDEX (PROCESS_ID), holding options
that change how run() executes the process. The first one is
CLOSE_ABSENT_ENTITIES: when 'Y', every run ends the validity of the
entities the process no longer produces (see
feature_data_processing.close_absent_entities).
Why a table of its own:
METADATAin the process catalog is descriptive; an option that changes what a run writes is not.- No
ALTERof the process catalog, andFS_V_PROCESS_CATALOGdoes not join this table: its text stays byte-identical, and a store where the table is missing (read-only user, refused CREATE) keeps a working catalog view. - A later option is a new column here.
The table is optional, like the manager registry: 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 option off".
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.
reset_state
¶
Forget what was learnt about the table (tests, setup(), connect()).
process_options_creation
¶
Create FS_PROCESS_OPTIONS 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_OPTIONS exists in the primary store (checked once per store).
switch_off_sql
¶
Turn an existing option off; a no-op when the process has no row.
read_process_options
¶
The options of process_id: {"close_absent_entities": bool, "track_entity_refresh": bool}.
close_absent_entities is read from FS_PROCESS_OPTIONS (unchanged), the newer
options from FS_PROCESS_SETTINGS (key/value, see process_settings). Each table
is optional and read on its own: fail-open, no table, no row or an unreadable table
reads as that option off, and a missing table never hides the other one.
record_process_options
¶
Record the options of process_id. Returns True when written (or nothing to write).
True writes the row (UPDATE ... ELSE INSERT). False only switches off an
existing row and is skipped when the table does not exist, so a store that never
uses the option gets no row. Raises on a database error when writing True.
filter_scope
¶
(ok, filter_columns, not_entity) for closing absent entities segment by segment.
A segment of a FilterManager can only tell which stored entities belong to it
when every filter column (BUSINESS_DATE of a time-filtering manager aside)
is an entity column: the close is then restricted to the stored entities that
match the active filter row. Pure.
set_process_options
¶
set_process_options(process_id: str, close_absent_entities: Optional[bool] = None, track_entity_refresh: Optional[bool] = None, dataset_time_manager: Optional[bool] = None, valid_time_column=None, force_varchar_length=None) -> dict
Change the execution options of an already-registered process.
close_absent_entities=True: every later run() / roll_out() of the
process ends the validity of the entities it no longer produces, at the run's
valid time. False switches it off. None leaves it as it is.
track_entity_refresh=True: every later run records, in an admin table
(FS_R_*, see tdfs4ds.entity_refresh), when each entity was last confirmed
by the process. False switches it off (the recorded history is kept).
dataset_time_manager=True: the dataset view a later run() builds follows the process's
TimeManager (build_dataset(time_manager=...)); False switches it off.
valid_time_column='<COLUMN>' (0.3.5.0): every later run writes each row of the process view
at its own valid time, read from that DATE / TIMESTAMP column (see upload_features).
False or '' switches it off. The next run replaces each entity's history from its
earliest valid time in the load onward.
force_varchar_length=N (0.3.5.1): the VARCHAR rounding later runs use for features they
register ('none' = exact lengths). A registered feature keeps its stored type: a run whose
source no longer fits it logs a warning naming tdfs4ds.plan_type_change.
Returns {"process_id", "close_absent_entities", "track_entity_refresh"} (the options
now in force). Raises ValueError for an unknown process or a FilterManager whose
columns are not entity columns, and RuntimeError when an options table cannot be used.