tdfs4ds.removal_log¶
tdfs4ds.removal_log
¶
Removal log: FS_REMOVAL_LOG (0.3.3.27).
One row per removal of a process, a feature, a dataset or stored values, and one
per removal refused because other objects depend on the object: who (the
database USER), when, what (its id and name, so a removed process can still
be named once its catalog rows are gone), whether it was forced, the
dependents, the origin (api, script, app) and the outcome
(REFUSED, RUNNING, COMPLETED, FAILED,<error>).
Optional, like the other tracking tables: created at setup() / connect()
when missing; a failed creation is one warning and is not retried in the
process; every write is fail-open (a removal never fails because its log row
could not be written). Plain table (not temporal): a removal is an event.
logger_safe
¶
Wrapper around the global logger that only emits logs when
tdfs4ds.DISPLAY_LOGS is True. level is a string like "info", "error", etc.
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.
removal_log_creation
¶
Create FS_REMOVAL_LOG and its view when missing. Never raises.
existing: the lower-cased object set connect() read from DBC; a table
found there costs no CREATE (its view is refreshed).
available
¶
Whether FS_REMOVAL_LOG exists in the primary store (checked once per store).
removal_origin
¶
Mark the removals of the block as coming from origin (script, app).
log_event
¶
log_event(kind: str, *, object_id=None, object_name=None, data_domain=None, process_id=None, forced: Optional[bool] = None, dependents=None, status: str = 'RUNNING', detail=None) -> str
Insert one row; returns its EVENT_ID (even when nothing could be written).
logged_removal
¶
Open a RUNNING row for the block; close it COMPLETED, or FAILED,<error>
and re-raise. The block may set ctx["status"] (e.g. a partial outcome).
get_removal_log
¶
get_removal_log(kind: Optional[str] = None, since=None, limit: Optional[int] = None) -> pd.DataFrame
The removal log, newest first: every removal, and every refusal.
kind: 'PROCESS', 'FEATURE', 'DATASET' or 'VALUES';
since: a date or timestamp. Empty frame when the table does not exist.
removed_processes
¶
{pid: {"name", "at", "user", "forced"}} of the last completed removal
of each process found in the log. Empty when the log is unavailable.