tdfs4ds.store_discovery¶
tdfs4ds.store_discovery
¶
Find the databases that hold a tdfs4ds feature store.
find_feature_stores() answers "which databases can I connect to?" without
connecting to any of them. It reads DBC.TablesV once, which lists only the
objects the session may see, and optionally counts each store's processes and
data domains through its public catalog view.
Raw SQL on purpose: a teradataml DataFrame is a view, and a view over DBC
needs a WITH GRANT OPTION right that an ordinary account often lacks (seen live:
Error 3523 on DBC.TablesV for a lab account whose raw query works).
required_catalog_tables
¶
The tables connect(create_if_missing=False) requires (it returns False without one).
_view_database_map
¶
Table database -> database of its FS_V_PROCESS_CATALOG view.
rows are (view database, view text). A store whose views live in the
same database maps to itself; a split store (database_view) is found by
the qualified table name its view reads.
find_feature_stores
¶
find_feature_stores(*, complete_only: bool = False, details: bool = True, databases: Optional[Iterable[str]] = None, run=None)
List the databases that hold a feature store, as a pandas DataFrame.
Parameters¶
complete_only : bool
Keep only stores that connect() accepts as they are (every required
catalog table present).
details : bool
Also count each store's current processes and data domains (one small
query per store, through its public process-catalog view). READABLE
is False when that read is refused.
databases : iterable of str, optional
Restrict the search to these databases.
run : callable, optional
run(sql) -> rows to read through another connection (launch_app
uses a raw teradatasql one, before any teradataml session exists).
Default: the teradataml context.
Returns¶
pandas.DataFrame
One row per database holding a feature catalog and a process catalog:
DATABASE_NAME, VIEW_DATABASE (where its catalog views are, None
when not found), COMPLETE, MISSING (comma-separated tables
connect() would need), and with details READABLE,
N_PROCESSES, N_DATA_DOMAINS and ERROR (why a store is not
readable, the whole message). Sorted by name. Empty when nothing
is visible to this session.
Only objects the session may see are listed (DBC.TablesV), so a store
the user has no right on does not appear.