tdfs4ds.data_domain¶
tdfs4ds.data_domain
¶
Data domain management for the tdfs4ds feature store.
A data domain is a logical namespace that isolates features by project or business unit. Use these functions to list, select, or create data domains within the feature store.
quote_ident
¶
Return name as a Teradata identifier, quoting it only if required.
Idempotent: an already-quoted name is returned unchanged rather than being
wrapped a second time. Embedded quotes are escaped as "".
Parameters¶
name : str
The raw object/database name.
force : bool, default False
Quote even when the name does not need it. Use only at the few sites
that have always emitted unconditional quotes and whose exact output is
already baked into persisted DDL (see
feature_store/feature_query_retrieval.py) — elsewhere forcing would
change the SQL of existing stores for no reason.
qualified
¶
Build db.obj with each part quoted only as needed.
qualified('TDB', 'FS_X') == 'TDB.FS_X' (unchanged for ordinary names);
qualified('SVC@CORP', 'FS_X') == '"SVC@CORP".FS_X'. An empty/None
database yields the bare object name, so unqualified callers keep working.
force=True quotes both parts unconditionally — only for the sites that
have always emitted quotes and whose exact text is already persisted (dataset
view DDL, returned volatile-table names).
split_qualified
¶
Split db.obj into (database, object), both de-quoted.
Quote-aware, so a dot inside a quoted part does not split the name:
split_qualified('"DEINF.CARLOSN"."FS_X"') == ('DEINF.CARLOSN', 'FS_X').
The naive rsplit('.', 1) this replaces returns ('"DEINF.CARLOSN"',
'"FS_X"') only by luck and ('"DEINF', 'CARLOSN"."FS_X"') in the
split('.') variant.
An unqualified name returns ('', name).
execute_query
¶
Execute a SQL query or a list of queries using the tdml module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str or list
|
A single SQL query string or a list of SQL query strings. |
required |
raise_error
|
bool
|
If True, re-raise exceptions after printing them. Default is False. |
False
|
fetch_results
|
bool
|
If True, fetch and return the results of the SQL execution. Default is False. |
False
|
quiet_errors
|
tuple
|
Lowercase substrings identifying failures the caller
EXPECTS and will handle itself. A matching failure is logged at DEBUG
instead of ERROR; whether it is re-raised is still governed by
|
()
|
log_errors
|
bool
|
False when the caller re-raises ( |
True
|
Returns: The result of the SQL execution if a single query is passed. None if a list of queries is passed or an exception occurs.
get_data_domains
¶
Retrieve and display all data domains available in the feature store.
Queries both the process catalog and the feature catalog for distinct DATA_DOMAIN values, then prints them with the currently active domain marked with an asterisk.
Parameters: - verbose (bool): If True, prints the list of data domains with the current one marked.
- list or None: When verbose=False, returns the list of data domain strings. When verbose=True, prints the list and returns None.
select_data_domain
¶
Set the active data domain for feature store operations.
All subsequent feature queries, registrations, and interactions with the feature store are scoped to this domain.
Parameters: - data_domain (str): The name of the data domain to set as active.
Raises: - ValueError: If the data domain does not exist in the feature store.
create_data_domain
¶
Create a new data domain in the feature store.
A data domain serves as a logical grouping for features, isolating them by project, business unit, or data type. The domain is activated locally; features uploaded afterward will be tagged with this domain.
Parameters: - data_domain (str): The name of the new data domain to be created.