Skip to content

tdfs4ds.deploy.sources

tdfs4ds.deploy.sources

Readers of a feature store for deployment bundles (0.3.8.15): the only I/O of export and plan.

Every function reads (SELECT / SHOW / HELP, never a write: a source guard test checks it), names the store's databases explicitly (never through read federation) and is fail-open: an object that cannot be read gives None / an empty value and the caller says so. Tests replace these functions; the pure layers (model, fingerprint, plan) never import teradataml.

_TYPE_CODES module-attribute

_TYPE_CODES = {'I': 'INTEGER', 'I1': 'BYTEINT', 'I2': 'SMALLINT', 'I8': 'BIGINT', 'F': 'FLOAT', 'DA': 'DATE', 'TS': 'TIMESTAMP', 'SZ': 'TIMESTAMP WITH TIME ZONE', 'AT': 'TIME', 'CO': 'CLOB', 'BO': 'BLOB', 'JN': 'JSON', 'PD': 'PERIOD(DATE)', 'PS': 'PERIOD(TIMESTAMP)'}

logger_safe

logger_safe(level, message, *args, **kwargs)

Wrapper around the global logger that only emits logs when tdfs4ds.DISPLAY_LOGS is True. level is a string like "info", "error", etc.

_execute

_execute(sql: str)

_rows

_rows(sql: str) -> List[Dict[str, Any]]

_q

_q(name: str) -> str

_lit

_lit(value) -> str

_u

_u(x) -> str

read_view_ddl

read_view_ddl(db: str, obj: str) -> Optional[str]

SHOW VIEW text, None when absent or unreadable.

read_table_ddl

read_table_ddl(db: str, obj: str) -> Optional[str]

SHOW TABLE text, None when absent or unreadable.

object_kinds

object_kinds(keys: Iterable[Tuple[str, str]]) -> Optional[Dict[Tuple[str, str], str]]

{(DB, OBJ): TableKind} of the objects that exist (one DBC.TablesV read per database); None when DBC cannot be read.

read_columns

read_columns(db: str, obj: str) -> Optional[List[Dict[str, str]]]

[{name, type}] in column order (type empty for a view), None when not listed.

_type_text

_type_text(ctype, length, digits, frac) -> str

read_process_catalog

read_process_catalog(view_schema: str) -> Optional[List[Dict[str, Any]]]

Current rows of FS_V_PROCESS_CATALOG of a store, None when unreadable.

read_process_extras

read_process_extras(schema: str, view_schema: str, process_id: str, data_domain: Optional[str], feature_names: Iterable[str]) -> Dict[str, Any]

{settings, storage_tag, feature_types} of a process. Fail-open per part.

_manager_setting

_manager_setting(schema: str, table_db: str, table: str, name: str) -> Optional[str]

read_time_manager

read_time_manager(schema: str, db: str, view: str, table_db: Optional[str] = None, table: Optional[str] = None, with_contents: bool = False) -> Optional[Dict[str, Any]]

Structure (data_type, calendar rule, previous) of a TimeManager, its number of dates, and its dates when with_contents. None when its table of dates does not exist.

read_filter_manager

read_filter_manager(db: str, view: str, table: Optional[str] = None, with_contents: bool = False) -> Optional[Dict[str, Any]]

Structure (filter_id_name, columns with types, time_filtering) of a FilterManager, its number of rows, and its rows when with_contents. None when its table does not exist.

read_domain_settings

read_domain_settings(schema: str, data_domain: str) -> Optional[Dict[str, str]]

_text

_text(value) -> str

read_feature_properties

read_feature_properties(view_schema: str, data_domain: str) -> List[Dict[str, Any]]

Declared feature properties of a domain (one dict per feature, ALLOWED_VALUES a JSON list).

read_glossary

read_glossary(view_schema: Optional[str]) -> List[Dict[str, Any]]

Glossary terms of a store (None = the primary): [{term, data_domain, meaning, synonyms, notes}].

read_attached

read_attached(schema: str) -> Dict[Tuple[str, str], str]

{(DB, OBJ): kind} of the objects attached to a store (its ATTACHED markers), read from the business-dictionary sections TABLE by explicit schema (0.3.8.15): the public sections view leaves the reserved sections out, so a reader of the view finds no attached object and a deployment created the attached views without attaching them (live). Fail-open: {}.

read_documentation

read_documentation(view_schema: str, objects: Iterable[Tuple[str, str]], process_ids: Optional[Dict[Tuple[str, str], str]] = None) -> Dict[Tuple[str, str], Dict]

{(DB, OBJ): {object_type, description, sections, columns, process, provenance}} from a store's business dictionary views (one read per table, IN lists). Objects without documentation are absent.

read_dataset

read_dataset(desc: Dict[str, Any], o: Dict[str, Any], pid_to_view: Dict[str, str]) -> Optional[Dict[str, Any]]

{entity, features, build} of a dataset: what build_dataset / build_historical_dataset needs to rebuild it, with each feature's producing process named by pid_to_view (pid -> view name) instead of its id. None when the dataset cannot be read.

find_dataset

find_dataset(view_schema: str, db: str, name: str) -> Optional[Dict[str, Any]]

{dataset_id, database, name} of a registered dataset, None when not registered.