Edit on GitHub

sqlmesh.core.config.plan

 1from __future__ import annotations
 2
 3import typing as t
 4
 5from sqlmesh.core.config.base import BaseConfig
 6from sqlmesh.core.config.categorizer import CategorizerConfig
 7
 8
 9class PlanConfig(BaseConfig):
10    """Configuration for a plan.
11
12    Args:
13        forward_only: Whether the plan should be forward-only.
14        auto_categorize_changes: Whether SQLMesh should attempt to automatically categorize model changes (breaking / non-breaking)
15            during plan creation.
16        include_unmodified: Whether to include unmodified models in the target development environment.
17        enable_preview: Whether to enable preview for forward-only models in development environments.
18        no_diff: Hide text differences for changed models.
19        no_prompts: Whether to disable interactive prompts for the backfill time range.
20        auto_apply: Whether to automatically apply the new plan after creation.
21        use_finalized_state: Whether to compare against the latest finalized environment state, or to use
22            whatever state the target environment is currently in.
23        always_recreate_environment: Whether to always recreate the target environment from the `create_from` environment.
24    """
25
26    forward_only: bool = False
27    auto_categorize_changes: CategorizerConfig = CategorizerConfig()
28    include_unmodified: bool = False
29    enable_preview: t.Optional[bool] = None
30    no_diff: bool = False
31    no_prompts: bool = True
32    auto_apply: bool = False
33    use_finalized_state: bool = False
34    always_recreate_environment: bool = False
class PlanConfig(sqlmesh.core.config.base.BaseConfig):
10class PlanConfig(BaseConfig):
11    """Configuration for a plan.
12
13    Args:
14        forward_only: Whether the plan should be forward-only.
15        auto_categorize_changes: Whether SQLMesh should attempt to automatically categorize model changes (breaking / non-breaking)
16            during plan creation.
17        include_unmodified: Whether to include unmodified models in the target development environment.
18        enable_preview: Whether to enable preview for forward-only models in development environments.
19        no_diff: Hide text differences for changed models.
20        no_prompts: Whether to disable interactive prompts for the backfill time range.
21        auto_apply: Whether to automatically apply the new plan after creation.
22        use_finalized_state: Whether to compare against the latest finalized environment state, or to use
23            whatever state the target environment is currently in.
24        always_recreate_environment: Whether to always recreate the target environment from the `create_from` environment.
25    """
26
27    forward_only: bool = False
28    auto_categorize_changes: CategorizerConfig = CategorizerConfig()
29    include_unmodified: bool = False
30    enable_preview: t.Optional[bool] = None
31    no_diff: bool = False
32    no_prompts: bool = True
33    auto_apply: bool = False
34    use_finalized_state: bool = False
35    always_recreate_environment: bool = False

Configuration for a plan.

Arguments:
  • forward_only: Whether the plan should be forward-only.
  • auto_categorize_changes: Whether SQLMesh should attempt to automatically categorize model changes (breaking / non-breaking) during plan creation.
  • include_unmodified: Whether to include unmodified models in the target development environment.
  • enable_preview: Whether to enable preview for forward-only models in development environments.
  • no_diff: Hide text differences for changed models.
  • no_prompts: Whether to disable interactive prompts for the backfill time range.
  • auto_apply: Whether to automatically apply the new plan after creation.
  • use_finalized_state: Whether to compare against the latest finalized environment state, or to use whatever state the target environment is currently in.
  • always_recreate_environment: Whether to always recreate the target environment from the create_from environment.
forward_only: bool
include_unmodified: bool
enable_preview: Optional[bool]
no_diff: bool
no_prompts: bool
auto_apply: bool
use_finalized_state: bool
always_recreate_environment: bool
model_config = {'json_encoders': {<class 'sqlglot.expressions.core.Expr'>: <function _expression_encoder>, <class 'sqlglot.expressions.datatypes.DataType'>: <function _expression_encoder>, <class 'sqlglot.expressions.query.Tuple'>: <function _expression_encoder>, typing.Union[sqlglot.expressions.query.Query, sqlmesh.core.dialect.JinjaQuery]: <function _expression_encoder>, typing.Union[sqlglot.expressions.query.Query, sqlmesh.core.dialect.JinjaQuery, sqlmesh.core.dialect.MacroFunc]: <function _expression_encoder>, <class 'datetime.tzinfo'>: <function PydanticModel.<lambda>>}, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Inherited Members
pydantic.main.BaseModel
BaseModel
model_fields
model_computed_fields
model_extra
model_fields_set
model_construct
model_copy
model_dump
model_dump_json
model_json_schema
model_parametrized_name
model_post_init
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
sqlmesh.utils.pydantic.PydanticModel
dict
json
copy
fields_set
parse_obj
parse_raw
missing_required_fields
extra_fields
all_fields
all_field_infos
required_fields