Skip to content

tdfs4ds.serve.code_connection

tdfs4ds.serve.code_connection

The connection lines shared by the code the app shows (0.3.6.13).

serve/dataset_code.py (Dataset builder > Show Python) and serve/page_code.py (the (?) icon of every page) open a session the same way: create_context with the password typed through getpass, then connect with the read-only stores attached. A token logon (TDFS4DS_TD_LOGDATA set) uses open_session instead. A secret never appears in the code. Pure: no database access.

FALLBACK_HOST module-attribute

FALLBACK_HOST = "input('Teradata host: ')"

FALLBACK_USER module-attribute

FALLBACK_USER = "input('Teradata user: ')"

FALLBACK_DB module-attribute

FALLBACK_DB = "input('Feature store database: ')"

lit

lit(value) -> str

readonly_arg

readonly_arg(readonly) -> list

The databases_readonly value: names, or the three-key descriptor for a store whose views live in another database or whose vector prefix is not the default.

_db_expr

_db_expr(store: str, fallback: str) -> str

connect_call

connect_call(store: str, readonly, *, fallback: str = "input('Feature store database: ')") -> str

tdfs4ds.connect(...) with the read-only stores when there are some. fallback is the expression used when no store is known (the page snippets ask; Show Python keeps its marker).

standalone_prologue

standalone_prologue(*, store: str, readonly, host: str, username: str, token_logon: bool, encrypt: bool = False, extra_imports=())

The lines that open the session, for a page snippet: (head, tail).

head = imports + logon + connect, ending before the try:; the page body goes inside try: and tail (finally: tdml.remove_context()) closes it. Unknown host, user or database are typed at the prompt (input), never left as a placeholder.