Edit on GitHub

sqlmesh.core.config.gateway

 1from __future__ import annotations
 2
 3import typing as t
 4
 5from sqlmesh.core import constants as c
 6from sqlmesh.core.config.base import BaseConfig
 7from sqlmesh.core.config.common import variables_validator
 8from sqlmesh.core.config.connection import (
 9    SerializableConnectionConfig,
10    connection_config_validator,
11)
12from sqlmesh.core.config.scheduler import SchedulerConfig
13
14
15class GatewayConfig(BaseConfig):
16    """Gateway configuration defines how SQLMesh should connect to the data warehouse,
17    the state backend and the scheduler.
18
19    Args:
20        connection: Connection configuration for the data warehouse.
21        state_connection: Connection configuration for the state backend. If not provided,
22            the same connection as the data warehouse will be used.
23        test_connection: Connection configuration for running unit tests.
24        scheduler: The scheduler configuration.
25        state_schema: Schema name to use for the state tables. If None or empty string are provided
26            then no schema name is used and therefore the default schema defined for the connection will be used
27        variables: A dictionary of gateway-specific variables that can be used in models / macros. This overrides
28            root-level variables by key.
29    """
30
31    connection: t.Optional[SerializableConnectionConfig] = None
32    state_connection: t.Optional[SerializableConnectionConfig] = None
33    test_connection: t.Optional[SerializableConnectionConfig] = None
34    scheduler: t.Optional[SchedulerConfig] = None
35    state_schema: t.Optional[str] = c.SQLMESH
36    variables: t.Dict[str, t.Any] = {}
37
38    _connection_config_validator = connection_config_validator
39    _variables_validator = variables_validator
class GatewayConfig(sqlmesh.core.config.base.BaseConfig):
16class GatewayConfig(BaseConfig):
17    """Gateway configuration defines how SQLMesh should connect to the data warehouse,
18    the state backend and the scheduler.
19
20    Args:
21        connection: Connection configuration for the data warehouse.
22        state_connection: Connection configuration for the state backend. If not provided,
23            the same connection as the data warehouse will be used.
24        test_connection: Connection configuration for running unit tests.
25        scheduler: The scheduler configuration.
26        state_schema: Schema name to use for the state tables. If None or empty string are provided
27            then no schema name is used and therefore the default schema defined for the connection will be used
28        variables: A dictionary of gateway-specific variables that can be used in models / macros. This overrides
29            root-level variables by key.
30    """
31
32    connection: t.Optional[SerializableConnectionConfig] = None
33    state_connection: t.Optional[SerializableConnectionConfig] = None
34    test_connection: t.Optional[SerializableConnectionConfig] = None
35    scheduler: t.Optional[SchedulerConfig] = None
36    state_schema: t.Optional[str] = c.SQLMESH
37    variables: t.Dict[str, t.Any] = {}
38
39    _connection_config_validator = connection_config_validator
40    _variables_validator = variables_validator

Gateway configuration defines how SQLMesh should connect to the data warehouse, the state backend and the scheduler.

Arguments:
  • connection: Connection configuration for the data warehouse.
  • state_connection: Connection configuration for the state backend. If not provided, the same connection as the data warehouse will be used.
  • test_connection: Connection configuration for running unit tests.
  • scheduler: The scheduler configuration.
  • state_schema: Schema name to use for the state tables. If None or empty string are provided then no schema name is used and therefore the default schema defined for the connection will be used
  • variables: A dictionary of gateway-specific variables that can be used in models / macros. This overrides root-level variables by key.
Inherited Members
pydantic.main.BaseModel
BaseModel
model_extra
model_fields_set
model_construct
model_copy
model_dump
model_dump_json
model_json_schema
model_parametrized_name
model_rebuild
model_validate
model_validate_json
model_validate_strings
parse_file
from_orm
construct
schema
schema_json
validate
update_forward_refs
sqlmesh.core.config.base.BaseConfig
update_with
model_post_init
sqlmesh.utils.pydantic.PydanticModel
dict
json
copy
parse_obj
parse_raw
missing_required_fields
extra_fields
all_fields
all_field_infos
required_fields