snowflake.core.schema.SchemaΒΆ

class snowflake.core.schema.Schema(name: str, created_on: datetime | None = None, kind: str | None = 'PERMANENT', is_default: bool | None = None, is_current: bool | None = None, database_name: str | None = None, owner: str | None = None, comment: str | None = None, options: str | None = None, managed_access: bool | None = False, retention_time: int | None = None, dropped_on: datetime | None = None, owner_role_type: str | None = None, budget: str | None = None, data_retention_time_in_days: int | None = None, default_ddl_collation: str | None = None, log_level: str | None = None, pipe_execution_paused: bool | None = None, max_data_extension_time_in_days: int | None = None, suspend_task_after_num_failures: int | None = None, trace_level: str | None = None, user_task_managed_initial_warehouse_size: str | None = None, user_task_timeout_ms: int | None = None)ΒΆ

Bases: object

A model object representing the ModelSchema resource.

Constructs an object of type ModelSchema with the provided properties.

Parameters:
  • name (str) – A Snowflake object identifier.

  • created_on (datetime, optional) – Date and time the schema was created.

  • kind (str, default 'PERMANENT') – Schema type, permanent (default) or transient.

  • is_default (bool, optional) – Default schema for a user.

  • is_current (bool, optional) – Current schema for the session.

  • database_name (str, optional) – Database that the schema belongs to

  • owner (str, optional) – Name of the role that owns the schema.

  • comment (str, optional) – Optional comment in which to store information related to the schema.

  • options (str, optional)

  • managed_access (bool, default False) – Whether this schema is a managed access schema that centralizes privilege management with the schema owner.

  • retention_time (int, optional) – Number of days that historical data is retained for Time Travel.

  • dropped_on (datetime, optional) – Date and time the schema was dropped.

  • owner_role_type (str, optional) – Type of role that owns the object, either ROLE or DATABASE_ROLE.

  • budget (str, optional) – Budget that defines a monthly spending limit on the compute costs for a Snowflake account or a custom group of Snowflake objects.

  • data_retention_time_in_days (int, optional) – Number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema

  • default_ddl_collation (str, optional) – Specifies a default collation specification for all tables added to the schema. You an override the default at the schema and individual table levels.

  • log_level (str, optional) – Severity level of messages that should be ingested and made available in the active event table. Currently, Snowflake supports only TRACE, DEBUG, INFO, WARN, ERROR, FATAL and OFF.

  • pipe_execution_paused (bool, optional) – Whether pipe execution is paused.

  • max_data_extension_time_in_days (int, optional) – Maximum number of days for which Snowflake can extend the data retention period for tables in the schema to prevent streams on the tables from becoming stale.

  • suspend_task_after_num_failures (int, optional) – Specifies the number of consecutive failed task runs after which the current task is suspended automatically.

  • trace_level (str, optional) – How trace events are ingested into the event table. Currently, Snowflake supports only ALWAYS, ON_EVENT, and OFF.

  • user_task_managed_initial_warehouse_size (str, optional) – Size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size.

  • user_task_timeout_ms (int, optional) – Time limit, in milliseconds, for a single run of the task before it times out.

Methods

classmethod from_dict(obj: dict) β†’ ModelSchemaModelΒΆ

Creates an instance of ModelSchema from a dict.

This method constructs a ModelSchema object from a dictionary with the key-value pairs of its properties.

Parameters:

obj (dict) – A dictionary whose keys and values correspond to the properties of the resource object.

Returns:

A ModelSchema object created using the input dictionary; this will fail if the required properties are missing.

Return type:

ModelSchema

to_dict()ΒΆ

Creates a dictionary of the properties from a ModelSchema.

This method constructs a dictionary with the key-value entries corresponding to the properties of the ModelSchema object.

Returns:

A dictionary object created using the input model.

Return type:

dict