tdfs4ds.deploy.actions¶
tdfs4ds.deploy.actions
¶
What apply_deployment does for each kind of object (0.3.8.15): the only writers of a deployment.
Each apply_<kind>(defn, values, ctx, replace) creates (or, when the plan says replace,
replaces) one object on the target from its definition, resolved to the environment. A database
error raises: apply_deployment stops there and reports it whole. The contents of an existing
manager (dates, segments) are never touched.
_PROVENANCE_SOURCES
module-attribute
¶
APPLIERS
module-attribute
¶
APPLIERS = {'requires': apply_requires, 'table': apply_table, 'view': apply_view, 'time_manager': apply_time_manager, 'filter_manager': apply_filter_manager, 'process': apply_process, 'domain': apply_domain, 'dataset': apply_dataset, 'glossary': apply_glossary, 'documentation': apply_documentation}
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.
resolve_sql
¶
{{VAR}} -> the database as an identifier (quoted only when needed), for SQL text.
resolve_value
¶
{{VAR}} -> the raw value (a database name as it is, for a YAML field or a catalog value).
A non-string passes through; an unknown variable raises KeyError naming it.
split_qualified
¶
Split 'db.obj' / '"db"."obj"' / 'obj' into (db, obj) (raw,
de-quoted but original case preserved). db is '' when unqualified.
_resolved_view
¶
'{{VAR}}.OBJ' -> 'DB.OBJ' (raw, as catalog columns and tdfs4ds arguments take it).
_table_present
¶
The table exists now (DBC). An earlier table action of the same plan creates a manager's hidden
table before the manager itself is applied (CREATE TABLE twice = Error 3803, live 0.3.8.15).
Fail-open to False: an unreadable answer keeps the old behaviour.
load_manager_contents
¶
Insert the bundled dates / rows into the (empty) table of a manager. Returns the rows inserted.
manager_statistics_sql
¶
The statistics a manager's own loader collects on its table (0.3.8.15): TIME_ID for a TimeManager
(collect_time_statistics), the filter id and the filter columns for a FilterManager (load_filter).
Pure.
_collect_manager_statistics
¶
Fail-open: a refusal (no STATISTICS right) is a debug line, never a failure of the deployment.
apply_time_manager
¶
Create a TimeManager's table of dates and view, EMPTY (or with the bundled dates), and record its calendar rule. Never called on an existing manager with rows (the plan refuses to replace one).
previous_literal
¶
The SQL literal of the first step's previous date of a TimeManager definition: the exported value
(info.previous_first), else the calendar rule's date before info.first_date; None when
neither is in the bundle. Pure.
create_previous_view
¶
Create <view>_PREVIOUS of a deployed TimeManager and record its PREVIOUS setting (0.3.8.15): a
process reading the previous-date view is registered right after the manager, before any date exists
(the EXPLAIN of its view needs the object). False (with a warning) when the first previous date is
unknown: compute_deployment then creates it once the dates exist.
upload_kwargs
¶
The upload_features keyword arguments that register defn on the target (no run). Pure
apart from building the manager objects (ctx['manager_factory']).
apply_process
¶
Register the process on the target WITHOUT running it (run_now=False), under its target data
domain, with PROCESS_DOMAIN_CHECK='error' for the call.
dataset_selection
¶
selected_features for build_dataset: each producing process VIEW resolved to the target's
PROCESS_ID by pid_of ('DB.VIEW' -> pid). Raises naming a process the target does not have.
_glossary_source
¶
The provenance a glossary term is written with: the source's (MANUAL / IMPORTED), else IMPORTED.
part_source
¶
The provenance a documentation part is written with on the target (0.3.8.15): the source's own
(provenance of the definition: MANUAL / IMPORTED / PROPAGATED / GENERATED), so a part a person wrote
stays protected and a PROPAGATED part keeps following its source; None (no provenance row, as in the
source) for a part the source has no provenance for. A definition carrying no provenance at all (written by
hand, or before 0.3.8.15) keeps the historical IMPORTED. Pure.
_by_source
¶
[(source, [(name, text), ...])] of a definition's sections / columns grouped by provenance. Pure.