marivo.datasource.trino#
- marivo.datasource.trino(name, *, host, catalog, port=None, schema=None, source=None, timezone=None, http_scheme=None, client_tags=None, session_properties=None, user_env=None, auth_env=None, ai_context=None, extra=None)[source]#
Declare a Trino datasource.
- Parameters:
name (str) – Global datasource name; letters, digits, underscores, and hyphens only.
host (str) – Trino coordinator host.
catalog (str) – Trino catalog; mapped to ibis database at connect time.
port (int | None) – Trino port; ibis default is 8080.
schema (str | None) – Optional default schema.
source (str | None) – Optional client application/source tag.
timezone (str | None) – Optional engine session timezone.
http_scheme (str | None) – Set to ‘https’ for TLS.
client_tags (tuple[str, ...] | None) – Optional Trino client tags.
session_properties (dict[str, str | int | float | bool | list[str | int | float | bool | list[JsonValue] | dict[str, JsonValue] | None] | dict[str, str | int | float | bool | list[JsonValue] | dict[str, JsonValue] | None] | None] | None) – Optional Trino session properties.
user_env (str | None) – Environment variable for Trino user.
auth_env (str | None) – Environment variable for Trino auth token or password.
ai_context (AiContextValue | None) – Optional AI-facing context, via
ms.ai_context(...). Put text descriptions inbusiness_definition.extra (dict[str, str | int | float | bool | list[str | int | float | bool | list[JsonValue] | dict[str, JsonValue] | None] | dict[str, str | int | float | bool | list[JsonValue] | dict[str, JsonValue] | None] | None] | None) – Rare JSON-safe ibis keyword arguments not modeled by the typed class.
- Returns:
TrinoSpecusable withmd.register(...)or.ref.- Return type:
Example
>>> import marivo.datasource as md >>> spec = md.trino( ... name="warehouse", ... host="trino.example", ... catalog="hive", ... schema="analytics", ... user_env="WAREHOUSE_USER", ... auth_env="WAREHOUSE_AUTH", ... ) >>> md.register(spec) >>> md.test(spec.ref).show() >>> md.inspect(spec.ref, md.table("orders")).show()
- Constraints:
When called while loading a datasource file, the spec is automatically declared for that project. Sensitive fields must use
*_envreferences, not plaintext literals.