sqlmesh 0.213.1.dev1__py3-none-any.whl → 0.227.2.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlmesh/__init__.py +12 -2
- sqlmesh/_version.py +2 -2
- sqlmesh/cli/main.py +0 -44
- sqlmesh/cli/project_init.py +11 -2
- sqlmesh/core/_typing.py +1 -0
- sqlmesh/core/audit/definition.py +8 -2
- sqlmesh/core/config/__init__.py +1 -1
- sqlmesh/core/config/connection.py +17 -5
- sqlmesh/core/config/dbt.py +13 -0
- sqlmesh/core/config/janitor.py +12 -0
- sqlmesh/core/config/loader.py +7 -0
- sqlmesh/core/config/model.py +2 -0
- sqlmesh/core/config/root.py +3 -0
- sqlmesh/core/console.py +81 -3
- sqlmesh/core/constants.py +1 -1
- sqlmesh/core/context.py +69 -26
- sqlmesh/core/dialect.py +3 -0
- sqlmesh/core/engine_adapter/_typing.py +2 -0
- sqlmesh/core/engine_adapter/base.py +322 -22
- sqlmesh/core/engine_adapter/base_postgres.py +17 -1
- sqlmesh/core/engine_adapter/bigquery.py +146 -7
- sqlmesh/core/engine_adapter/clickhouse.py +17 -13
- sqlmesh/core/engine_adapter/databricks.py +33 -2
- sqlmesh/core/engine_adapter/fabric.py +10 -29
- sqlmesh/core/engine_adapter/mixins.py +142 -48
- sqlmesh/core/engine_adapter/mssql.py +15 -4
- sqlmesh/core/engine_adapter/mysql.py +2 -2
- sqlmesh/core/engine_adapter/postgres.py +9 -3
- sqlmesh/core/engine_adapter/redshift.py +4 -0
- sqlmesh/core/engine_adapter/risingwave.py +1 -0
- sqlmesh/core/engine_adapter/shared.py +6 -0
- sqlmesh/core/engine_adapter/snowflake.py +82 -11
- sqlmesh/core/engine_adapter/spark.py +14 -10
- sqlmesh/core/engine_adapter/trino.py +4 -2
- sqlmesh/core/environment.py +2 -0
- sqlmesh/core/janitor.py +181 -0
- sqlmesh/core/lineage.py +1 -0
- sqlmesh/core/linter/definition.py +13 -13
- sqlmesh/core/linter/rules/builtin.py +29 -0
- sqlmesh/core/macros.py +35 -13
- sqlmesh/core/model/common.py +2 -0
- sqlmesh/core/model/definition.py +82 -28
- sqlmesh/core/model/kind.py +66 -2
- sqlmesh/core/model/meta.py +108 -4
- sqlmesh/core/node.py +101 -1
- sqlmesh/core/plan/builder.py +18 -10
- sqlmesh/core/plan/common.py +199 -2
- sqlmesh/core/plan/definition.py +25 -6
- sqlmesh/core/plan/evaluator.py +75 -113
- sqlmesh/core/plan/explainer.py +90 -8
- sqlmesh/core/plan/stages.py +42 -21
- sqlmesh/core/renderer.py +78 -32
- sqlmesh/core/scheduler.py +102 -22
- sqlmesh/core/selector.py +137 -9
- sqlmesh/core/signal.py +64 -1
- sqlmesh/core/snapshot/__init__.py +2 -0
- sqlmesh/core/snapshot/definition.py +146 -34
- sqlmesh/core/snapshot/evaluator.py +689 -124
- sqlmesh/core/state_sync/__init__.py +0 -1
- sqlmesh/core/state_sync/base.py +55 -33
- sqlmesh/core/state_sync/cache.py +12 -7
- sqlmesh/core/state_sync/common.py +216 -111
- sqlmesh/core/state_sync/db/environment.py +6 -4
- sqlmesh/core/state_sync/db/facade.py +42 -24
- sqlmesh/core/state_sync/db/interval.py +27 -7
- sqlmesh/core/state_sync/db/migrator.py +34 -16
- sqlmesh/core/state_sync/db/snapshot.py +177 -169
- sqlmesh/core/table_diff.py +2 -2
- sqlmesh/core/test/context.py +2 -0
- sqlmesh/core/test/definition.py +14 -9
- sqlmesh/dbt/adapter.py +22 -16
- sqlmesh/dbt/basemodel.py +75 -56
- sqlmesh/dbt/builtin.py +116 -12
- sqlmesh/dbt/column.py +17 -5
- sqlmesh/dbt/common.py +19 -5
- sqlmesh/dbt/context.py +14 -1
- sqlmesh/dbt/loader.py +61 -9
- sqlmesh/dbt/manifest.py +174 -16
- sqlmesh/dbt/model.py +183 -85
- sqlmesh/dbt/package.py +16 -1
- sqlmesh/dbt/profile.py +3 -3
- sqlmesh/dbt/project.py +12 -7
- sqlmesh/dbt/seed.py +6 -1
- sqlmesh/dbt/source.py +13 -1
- sqlmesh/dbt/target.py +25 -6
- sqlmesh/dbt/test.py +36 -5
- sqlmesh/migrations/v0000_baseline.py +95 -0
- sqlmesh/migrations/v0061_mysql_fix_blob_text_type.py +5 -7
- sqlmesh/migrations/v0062_add_model_gateway.py +5 -1
- sqlmesh/migrations/v0063_change_signals.py +5 -3
- sqlmesh/migrations/v0064_join_when_matched_strings.py +5 -3
- sqlmesh/migrations/v0065_add_model_optimize.py +5 -1
- sqlmesh/migrations/v0066_add_auto_restatements.py +8 -3
- sqlmesh/migrations/v0067_add_tsql_date_full_precision.py +5 -1
- sqlmesh/migrations/v0068_include_unrendered_query_in_metadata_hash.py +5 -1
- sqlmesh/migrations/v0069_update_dev_table_suffix.py +5 -3
- sqlmesh/migrations/v0070_include_grains_in_metadata_hash.py +5 -1
- sqlmesh/migrations/v0071_add_dev_version_to_intervals.py +9 -5
- sqlmesh/migrations/v0072_add_environment_statements.py +5 -3
- sqlmesh/migrations/v0073_remove_symbolic_disable_restatement.py +5 -3
- sqlmesh/migrations/v0074_add_partition_by_time_column_property.py +5 -1
- sqlmesh/migrations/v0075_remove_validate_query.py +5 -3
- sqlmesh/migrations/v0076_add_cron_tz.py +5 -1
- sqlmesh/migrations/v0077_fix_column_type_hash_calculation.py +5 -1
- sqlmesh/migrations/v0078_warn_if_non_migratable_python_env.py +5 -3
- sqlmesh/migrations/v0079_add_gateway_managed_property.py +10 -5
- sqlmesh/migrations/v0080_add_batch_size_to_scd_type_2_models.py +5 -1
- sqlmesh/migrations/v0081_update_partitioned_by.py +5 -3
- sqlmesh/migrations/v0082_warn_if_incorrectly_duplicated_statements.py +5 -3
- sqlmesh/migrations/v0083_use_sql_for_scd_time_data_type_data_hash.py +5 -1
- sqlmesh/migrations/v0084_normalize_quote_when_matched_and_merge_filter.py +5 -1
- sqlmesh/migrations/v0085_deterministic_repr.py +5 -3
- sqlmesh/migrations/v0086_check_deterministic_bug.py +5 -3
- sqlmesh/migrations/v0087_normalize_blueprint_variables.py +5 -3
- sqlmesh/migrations/v0088_warn_about_variable_python_env_diffs.py +5 -3
- sqlmesh/migrations/v0089_add_virtual_environment_mode.py +5 -1
- sqlmesh/migrations/v0090_add_forward_only_column.py +9 -5
- sqlmesh/migrations/v0091_on_additive_change.py +5 -1
- sqlmesh/migrations/v0092_warn_about_dbt_data_type_diff.py +5 -3
- sqlmesh/migrations/v0093_use_raw_sql_in_fingerprint.py +5 -1
- sqlmesh/migrations/v0094_add_dev_version_and_fingerprint_columns.py +123 -0
- sqlmesh/migrations/v0095_warn_about_dbt_raw_sql_diff.py +49 -0
- sqlmesh/migrations/v0096_remove_plan_dags_table.py +13 -0
- sqlmesh/migrations/v0097_add_dbt_name_in_node.py +9 -0
- sqlmesh/migrations/{v0060_move_audits_to_model.py → v0098_add_dbt_node_info_in_node.py} +33 -16
- sqlmesh/migrations/v0099_add_last_altered_to_intervals.py +25 -0
- sqlmesh/migrations/v0100_add_grants_and_grants_target_layer.py +9 -0
- sqlmesh/utils/__init__.py +8 -1
- sqlmesh/utils/cache.py +5 -1
- sqlmesh/utils/connection_pool.py +2 -1
- sqlmesh/utils/dag.py +65 -10
- sqlmesh/utils/date.py +8 -1
- sqlmesh/utils/errors.py +8 -0
- sqlmesh/utils/jinja.py +54 -4
- sqlmesh/utils/pydantic.py +6 -6
- sqlmesh/utils/windows.py +13 -3
- {sqlmesh-0.213.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/METADATA +7 -10
- sqlmesh-0.227.2.dev4.dist-info/RECORD +370 -0
- sqlmesh_dbt/cli.py +70 -7
- sqlmesh_dbt/console.py +14 -6
- sqlmesh_dbt/operations.py +103 -24
- sqlmesh_dbt/selectors.py +39 -1
- web/client/dist/assets/{Audits-Ucsx1GzF.js → Audits-CBiYyyx-.js} +1 -1
- web/client/dist/assets/{Banner-BWDzvavM.js → Banner-DSRbUlO5.js} +1 -1
- web/client/dist/assets/{ChevronDownIcon-D2VL13Ah.js → ChevronDownIcon-MK_nrjD_.js} +1 -1
- web/client/dist/assets/{ChevronRightIcon-DWGYbf1l.js → ChevronRightIcon-CLWtT22Q.js} +1 -1
- web/client/dist/assets/{Content-DdHDZM3I.js → Content-BNuGZN5l.js} +1 -1
- web/client/dist/assets/{Content-Bikfy8fh.js → Content-CSHJyW0n.js} +1 -1
- web/client/dist/assets/{Data-CzAJH7rW.js → Data-C1oRDbLx.js} +1 -1
- web/client/dist/assets/{DataCatalog-BJF11g8f.js → DataCatalog-HXyX2-_j.js} +1 -1
- web/client/dist/assets/{Editor-s0SBpV2y.js → Editor-BDyfpUuw.js} +1 -1
- web/client/dist/assets/{Editor-DgLhgKnm.js → Editor-D0jNItwC.js} +1 -1
- web/client/dist/assets/{Errors-D0m0O1d3.js → Errors-BfuFLcPi.js} +1 -1
- web/client/dist/assets/{FileExplorer-CEv0vXkt.js → FileExplorer-BR9IE3he.js} +1 -1
- web/client/dist/assets/{Footer-BwzXn8Ew.js → Footer-CgBEtiAh.js} +1 -1
- web/client/dist/assets/{Header-6heDkEqG.js → Header-DSqR6nSO.js} +1 -1
- web/client/dist/assets/{Input-obuJsD6k.js → Input-B-oZ6fGO.js} +1 -1
- web/client/dist/assets/Lineage-DYQVwDbD.js +1 -0
- web/client/dist/assets/{ListboxShow-HM9_qyrt.js → ListboxShow-BE5-xevs.js} +1 -1
- web/client/dist/assets/{ModelLineage-zWdKo0U2.js → ModelLineage-DkIFAYo4.js} +1 -1
- web/client/dist/assets/{Models-Bcu66SRz.js → Models-D5dWr8RB.js} +1 -1
- web/client/dist/assets/{Page-BWEEQfIt.js → Page-C-XfU5BR.js} +1 -1
- web/client/dist/assets/{Plan-C4gXCqlf.js → Plan-ZEuTINBq.js} +1 -1
- web/client/dist/assets/{PlusCircleIcon-CVDO651q.js → PlusCircleIcon-DVXAHG8_.js} +1 -1
- web/client/dist/assets/{ReportErrors-BT6xFwAr.js → ReportErrors-B7FEPzMB.js} +1 -1
- web/client/dist/assets/{Root-ryJoBK4h.js → Root-8aZyhPxF.js} +1 -1
- web/client/dist/assets/{SearchList-DB04sPb9.js → SearchList-W_iT2G82.js} +1 -1
- web/client/dist/assets/{SelectEnvironment-CUYcXUu6.js → SelectEnvironment-C65jALmO.js} +1 -1
- web/client/dist/assets/{SourceList-Doo_9ZGp.js → SourceList-DSLO6nVJ.js} +1 -1
- web/client/dist/assets/{SourceListItem-D5Mj7Dly.js → SourceListItem-BHt8d9-I.js} +1 -1
- web/client/dist/assets/{SplitPane-qHmkD1qy.js → SplitPane-CViaZmw6.js} +1 -1
- web/client/dist/assets/{Tests-DH1Z74ML.js → Tests-DhaVt5t1.js} +1 -1
- web/client/dist/assets/{Welcome-DqUJUNMF.js → Welcome-DvpjH-_4.js} +1 -1
- web/client/dist/assets/context-BctCsyGb.js +71 -0
- web/client/dist/assets/{context-Dr54UHLi.js → context-DFNeGsFF.js} +1 -1
- web/client/dist/assets/{editor-DYIP1yQ4.js → editor-CcO28cqd.js} +1 -1
- web/client/dist/assets/{file-DarlIDVi.js → file-CvJN3aZO.js} +1 -1
- web/client/dist/assets/{floating-ui.react-dom-BH3TFvkM.js → floating-ui.react-dom-CjE-JNW1.js} +1 -1
- web/client/dist/assets/{help-Bl8wqaQc.js → help-DuPhjipa.js} +1 -1
- web/client/dist/assets/{index-D1sR7wpN.js → index-C-dJH7yZ.js} +1 -1
- web/client/dist/assets/{index-O3mjYpnE.js → index-Dj0i1-CA.js} +2 -2
- web/client/dist/assets/{plan-CehRrJUG.js → plan-BTRSbjKn.js} +1 -1
- web/client/dist/assets/{popover-CqgMRE0G.js → popover-_Sf0yvOI.js} +1 -1
- web/client/dist/assets/{project-6gxepOhm.js → project-BvSOI8MY.js} +1 -1
- web/client/dist/index.html +1 -1
- sqlmesh/integrations/llm.py +0 -56
- sqlmesh/migrations/v0001_init.py +0 -60
- sqlmesh/migrations/v0002_remove_identify.py +0 -5
- sqlmesh/migrations/v0003_move_batch_size.py +0 -34
- sqlmesh/migrations/v0004_environmnent_add_finalized_at.py +0 -23
- sqlmesh/migrations/v0005_create_seed_table.py +0 -24
- sqlmesh/migrations/v0006_change_seed_hash.py +0 -5
- sqlmesh/migrations/v0007_env_table_info_to_kind.py +0 -99
- sqlmesh/migrations/v0008_create_intervals_table.py +0 -38
- sqlmesh/migrations/v0009_remove_pre_post_hooks.py +0 -62
- sqlmesh/migrations/v0010_seed_hash_batch_size.py +0 -5
- sqlmesh/migrations/v0011_add_model_kind_name.py +0 -63
- sqlmesh/migrations/v0012_update_jinja_expressions.py +0 -86
- sqlmesh/migrations/v0013_serde_using_model_dialects.py +0 -87
- sqlmesh/migrations/v0014_fix_dev_intervals.py +0 -14
- sqlmesh/migrations/v0015_environment_add_promoted_snapshot_ids.py +0 -26
- sqlmesh/migrations/v0016_fix_windows_path.py +0 -59
- sqlmesh/migrations/v0017_fix_windows_seed_path.py +0 -55
- sqlmesh/migrations/v0018_rename_snapshot_model_to_node.py +0 -53
- sqlmesh/migrations/v0019_add_env_suffix_target.py +0 -28
- sqlmesh/migrations/v0020_remove_redundant_attributes_from_dbt_models.py +0 -80
- sqlmesh/migrations/v0021_fix_table_properties.py +0 -62
- sqlmesh/migrations/v0022_move_project_to_model.py +0 -54
- sqlmesh/migrations/v0023_fix_added_models_with_forward_only_parents.py +0 -65
- sqlmesh/migrations/v0024_replace_model_kind_name_enum_with_value.py +0 -55
- sqlmesh/migrations/v0025_fix_intervals_and_missing_change_category.py +0 -117
- sqlmesh/migrations/v0026_remove_dialect_from_seed.py +0 -55
- sqlmesh/migrations/v0027_minute_interval_to_five.py +0 -57
- sqlmesh/migrations/v0028_add_plan_dags_table.py +0 -29
- sqlmesh/migrations/v0029_generate_schema_types_using_dialect.py +0 -69
- sqlmesh/migrations/v0030_update_unrestorable_snapshots.py +0 -65
- sqlmesh/migrations/v0031_remove_dbt_target_fields.py +0 -65
- sqlmesh/migrations/v0032_add_sqlmesh_version.py +0 -25
- sqlmesh/migrations/v0033_mysql_fix_blob_text_type.py +0 -45
- sqlmesh/migrations/v0034_add_default_catalog.py +0 -367
- sqlmesh/migrations/v0035_add_catalog_name_override.py +0 -22
- sqlmesh/migrations/v0036_delete_plan_dags_bug_fix.py +0 -14
- sqlmesh/migrations/v0037_remove_dbt_is_incremental_macro.py +0 -61
- sqlmesh/migrations/v0038_add_expiration_ts_to_snapshot.py +0 -73
- sqlmesh/migrations/v0039_include_environment_in_plan_dag_spec.py +0 -68
- sqlmesh/migrations/v0040_add_previous_finalized_snapshots.py +0 -26
- sqlmesh/migrations/v0041_remove_hash_raw_query_attribute.py +0 -59
- sqlmesh/migrations/v0042_trim_indirect_versions.py +0 -66
- sqlmesh/migrations/v0043_fix_remove_obsolete_attributes_in_plan_dags.py +0 -61
- sqlmesh/migrations/v0044_quote_identifiers_in_model_attributes.py +0 -5
- sqlmesh/migrations/v0045_move_gateway_variable.py +0 -70
- sqlmesh/migrations/v0046_add_batch_concurrency.py +0 -8
- sqlmesh/migrations/v0047_change_scd_string_to_column.py +0 -5
- sqlmesh/migrations/v0048_drop_indirect_versions.py +0 -59
- sqlmesh/migrations/v0049_replace_identifier_with_version_in_seeds_table.py +0 -57
- sqlmesh/migrations/v0050_drop_seeds_table.py +0 -11
- sqlmesh/migrations/v0051_rename_column_descriptions.py +0 -65
- sqlmesh/migrations/v0052_add_normalize_name_in_environment_naming_info.py +0 -28
- sqlmesh/migrations/v0053_custom_model_kind_extra_attributes.py +0 -5
- sqlmesh/migrations/v0054_fix_trailing_comments.py +0 -5
- sqlmesh/migrations/v0055_add_updated_ts_unpaused_ts_ttl_ms_unrestorable_to_snapshot.py +0 -132
- sqlmesh/migrations/v0056_restore_table_indexes.py +0 -118
- sqlmesh/migrations/v0057_add_table_format.py +0 -5
- sqlmesh/migrations/v0058_add_requirements.py +0 -26
- sqlmesh/migrations/v0059_add_physical_version.py +0 -5
- sqlmesh-0.213.1.dev1.dist-info/RECORD +0 -421
- web/client/dist/assets/Lineage-D0Hgdz2v.js +0 -1
- web/client/dist/assets/context-DgX0fp2E.js +0 -68
- {sqlmesh-0.213.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/WHEEL +0 -0
- {sqlmesh-0.213.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.213.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.213.1.dev1.dist-info → sqlmesh-0.227.2.dev4.dist-info}/top_level.txt +0 -0
sqlmesh/dbt/test.py
CHANGED
|
@@ -8,11 +8,11 @@ from pathlib import Path
|
|
|
8
8
|
from pydantic import Field
|
|
9
9
|
import sqlmesh.core.dialect as d
|
|
10
10
|
from sqlmesh.core.audit import Audit, ModelAudit, StandaloneAudit
|
|
11
|
+
from sqlmesh.core.node import DbtNodeInfo
|
|
11
12
|
from sqlmesh.dbt.common import (
|
|
12
13
|
Dependencies,
|
|
13
14
|
GeneralConfig,
|
|
14
15
|
SqlStr,
|
|
15
|
-
extract_jinja_config,
|
|
16
16
|
sql_str_validator,
|
|
17
17
|
)
|
|
18
18
|
from sqlmesh.utils import AttributeDict
|
|
@@ -61,6 +61,10 @@ class TestConfig(GeneralConfig):
|
|
|
61
61
|
error_if: Conditional expression (default "!=0") to detect if error condition met (Not supported).
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
|
+
__test__ = (
|
|
65
|
+
False # prevent pytest trying to collect this as a test class when it's imported in a test
|
|
66
|
+
)
|
|
67
|
+
|
|
64
68
|
# SQLMesh fields
|
|
65
69
|
path: Path = Path()
|
|
66
70
|
name: str
|
|
@@ -76,8 +80,10 @@ class TestConfig(GeneralConfig):
|
|
|
76
80
|
dialect_: t.Optional[str] = Field(None, alias="dialect")
|
|
77
81
|
|
|
78
82
|
# dbt fields
|
|
83
|
+
unique_id: str = ""
|
|
79
84
|
package_name: str = ""
|
|
80
85
|
alias: t.Optional[str] = None
|
|
86
|
+
fqn: t.List[str] = []
|
|
81
87
|
schema_: t.Optional[str] = Field("", alias="schema")
|
|
82
88
|
database: t.Optional[str] = None
|
|
83
89
|
severity: Severity = Severity.ERROR
|
|
@@ -103,9 +109,28 @@ class TestConfig(GeneralConfig):
|
|
|
103
109
|
def _lowercase_name(cls, v: str) -> str:
|
|
104
110
|
return v.lower()
|
|
105
111
|
|
|
112
|
+
@property
|
|
113
|
+
def canonical_name(self) -> str:
|
|
114
|
+
return f"{self.package_name}.{self.name}".lower() if self.package_name else self.name
|
|
115
|
+
|
|
106
116
|
@property
|
|
107
117
|
def is_standalone(self) -> bool:
|
|
108
|
-
|
|
118
|
+
# A test is standalone if:
|
|
119
|
+
# 1. It has no model_name (already standalone), OR
|
|
120
|
+
# 2. It references other models besides its own model
|
|
121
|
+
if not self.model_name:
|
|
122
|
+
return True
|
|
123
|
+
|
|
124
|
+
# Check if test has references to other models
|
|
125
|
+
# For versioned models, refs include version (e.g., "model_name_v1") but model_name may not
|
|
126
|
+
self_refs = {self.model_name}
|
|
127
|
+
for ref in self.dependencies.refs:
|
|
128
|
+
# versioned models end in _vX
|
|
129
|
+
if ref.startswith(f"{self.model_name}_v"):
|
|
130
|
+
self_refs.add(ref)
|
|
131
|
+
|
|
132
|
+
other_refs = {ref for ref in self.dependencies.refs if ref not in self_refs}
|
|
133
|
+
return bool(other_refs)
|
|
109
134
|
|
|
110
135
|
@property
|
|
111
136
|
def sqlmesh_config_fields(self) -> t.Set[str]:
|
|
@@ -134,9 +159,7 @@ class TestConfig(GeneralConfig):
|
|
|
134
159
|
}
|
|
135
160
|
)
|
|
136
161
|
|
|
137
|
-
|
|
138
|
-
sql_no_config = sql_no_config.replace("**_dbt_generic_test_kwargs", self._kwargs())
|
|
139
|
-
query = d.jinja_query(sql_no_config)
|
|
162
|
+
query = d.jinja_query(self.sql.replace("**_dbt_generic_test_kwargs", self._kwargs()))
|
|
140
163
|
|
|
141
164
|
skip = not self.enabled
|
|
142
165
|
blocking = self.severity == Severity.ERROR
|
|
@@ -146,6 +169,7 @@ class TestConfig(GeneralConfig):
|
|
|
146
169
|
jinja_macros.add_globals({"this": self.relation_info})
|
|
147
170
|
audit = StandaloneAudit(
|
|
148
171
|
name=self.name,
|
|
172
|
+
dbt_node_info=self.node_info,
|
|
149
173
|
dialect=self.dialect(context),
|
|
150
174
|
skip=skip,
|
|
151
175
|
query=query,
|
|
@@ -162,6 +186,7 @@ class TestConfig(GeneralConfig):
|
|
|
162
186
|
else:
|
|
163
187
|
audit = ModelAudit(
|
|
164
188
|
name=self.name,
|
|
189
|
+
dbt_node_info=self.node_info,
|
|
165
190
|
dialect=self.dialect(context),
|
|
166
191
|
skip=skip,
|
|
167
192
|
blocking=blocking,
|
|
@@ -205,6 +230,12 @@ class TestConfig(GeneralConfig):
|
|
|
205
230
|
}
|
|
206
231
|
)
|
|
207
232
|
|
|
233
|
+
@property
|
|
234
|
+
def node_info(self) -> DbtNodeInfo:
|
|
235
|
+
return DbtNodeInfo(
|
|
236
|
+
unique_id=self.unique_id, name=self.name, fqn=".".join(self.fqn), alias=self.alias
|
|
237
|
+
)
|
|
238
|
+
|
|
208
239
|
|
|
209
240
|
def _remove_jinja_braces(jinja_str: str) -> str:
|
|
210
241
|
no_braces = jinja_str
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""The baseline migration script that sets up the initial state tables."""
|
|
2
|
+
|
|
3
|
+
from sqlglot import exp
|
|
4
|
+
from sqlmesh.utils.migration import blob_text_type, index_text_type
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
8
|
+
intervals_table = "_intervals"
|
|
9
|
+
snapshots_table = "_snapshots"
|
|
10
|
+
environments_table = "_environments"
|
|
11
|
+
versions_table = "_versions"
|
|
12
|
+
if schema:
|
|
13
|
+
engine_adapter.create_schema(schema)
|
|
14
|
+
intervals_table = f"{schema}.{intervals_table}"
|
|
15
|
+
snapshots_table = f"{schema}.{snapshots_table}"
|
|
16
|
+
environments_table = f"{schema}.{environments_table}"
|
|
17
|
+
versions_table = f"{schema}.{versions_table}"
|
|
18
|
+
|
|
19
|
+
index_type = index_text_type(engine_adapter.dialect)
|
|
20
|
+
blob_type = blob_text_type(engine_adapter.dialect)
|
|
21
|
+
|
|
22
|
+
snapshots_columns_to_types = {
|
|
23
|
+
"name": exp.DataType.build(index_type),
|
|
24
|
+
"identifier": exp.DataType.build(index_type),
|
|
25
|
+
"version": exp.DataType.build(index_type),
|
|
26
|
+
"snapshot": exp.DataType.build(blob_type),
|
|
27
|
+
"kind_name": exp.DataType.build(index_type),
|
|
28
|
+
"updated_ts": exp.DataType.build("bigint"),
|
|
29
|
+
"unpaused_ts": exp.DataType.build("bigint"),
|
|
30
|
+
"ttl_ms": exp.DataType.build("bigint"),
|
|
31
|
+
"unrestorable": exp.DataType.build("boolean"),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
environments_columns_to_types = {
|
|
35
|
+
"name": exp.DataType.build(index_type),
|
|
36
|
+
"snapshots": exp.DataType.build(blob_type),
|
|
37
|
+
"start_at": exp.DataType.build("text"),
|
|
38
|
+
"end_at": exp.DataType.build("text"),
|
|
39
|
+
"plan_id": exp.DataType.build("text"),
|
|
40
|
+
"previous_plan_id": exp.DataType.build("text"),
|
|
41
|
+
"expiration_ts": exp.DataType.build("bigint"),
|
|
42
|
+
"finalized_ts": exp.DataType.build("bigint"),
|
|
43
|
+
"promoted_snapshot_ids": exp.DataType.build(blob_type),
|
|
44
|
+
"suffix_target": exp.DataType.build("text"),
|
|
45
|
+
"catalog_name_override": exp.DataType.build("text"),
|
|
46
|
+
"previous_finalized_snapshots": exp.DataType.build(blob_type),
|
|
47
|
+
"normalize_name": exp.DataType.build("boolean"),
|
|
48
|
+
"requirements": exp.DataType.build(blob_type),
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
intervals_columns_to_types = {
|
|
52
|
+
"id": exp.DataType.build(index_type),
|
|
53
|
+
"created_ts": exp.DataType.build("bigint"),
|
|
54
|
+
"name": exp.DataType.build(index_type),
|
|
55
|
+
"identifier": exp.DataType.build(index_type),
|
|
56
|
+
"version": exp.DataType.build(index_type),
|
|
57
|
+
"start_ts": exp.DataType.build("bigint"),
|
|
58
|
+
"end_ts": exp.DataType.build("bigint"),
|
|
59
|
+
"is_dev": exp.DataType.build("boolean"),
|
|
60
|
+
"is_removed": exp.DataType.build("boolean"),
|
|
61
|
+
"is_compacted": exp.DataType.build("boolean"),
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
versions_columns_to_types = {
|
|
65
|
+
"schema_version": exp.DataType.build("int"),
|
|
66
|
+
"sqlglot_version": exp.DataType.build(index_type),
|
|
67
|
+
"sqlmesh_version": exp.DataType.build(index_type),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# Create the versions table.
|
|
71
|
+
engine_adapter.create_state_table(versions_table, versions_columns_to_types)
|
|
72
|
+
|
|
73
|
+
# Create the snapshots table and its indexes.
|
|
74
|
+
engine_adapter.create_state_table(
|
|
75
|
+
snapshots_table, snapshots_columns_to_types, primary_key=("name", "identifier")
|
|
76
|
+
)
|
|
77
|
+
engine_adapter.create_index(snapshots_table, "_snapshots_name_version_idx", ("name", "version"))
|
|
78
|
+
|
|
79
|
+
# Create the environments table and its indexes.
|
|
80
|
+
engine_adapter.create_state_table(
|
|
81
|
+
environments_table, environments_columns_to_types, primary_key=("name",)
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# Create the intervals table and its indexes.
|
|
85
|
+
engine_adapter.create_state_table(
|
|
86
|
+
intervals_table, intervals_columns_to_types, primary_key=("id",)
|
|
87
|
+
)
|
|
88
|
+
engine_adapter.create_index(
|
|
89
|
+
intervals_table, "_intervals_name_identifier_idx", ("name", "identifier")
|
|
90
|
+
)
|
|
91
|
+
engine_adapter.create_index(intervals_table, "_intervals_name_version_idx", ("name", "version"))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
95
|
+
pass
|
|
@@ -9,20 +9,15 @@ from sqlglot import exp
|
|
|
9
9
|
from sqlmesh.utils.migration import blob_text_type
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def
|
|
13
|
-
engine_adapter = state_sync.engine_adapter
|
|
12
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
14
13
|
if engine_adapter.dialect != "mysql":
|
|
15
14
|
return
|
|
16
|
-
|
|
17
|
-
schema = state_sync.schema
|
|
18
15
|
environments_table = "_environments"
|
|
19
16
|
snapshots_table = "_snapshots"
|
|
20
|
-
plan_dags_table = "_plan_dags"
|
|
21
17
|
|
|
22
18
|
if schema:
|
|
23
19
|
environments_table = f"{schema}.{environments_table}"
|
|
24
20
|
snapshots_table = f"{schema}.{snapshots_table}"
|
|
25
|
-
plan_dags_table = f"{schema}.{plan_dags_table}"
|
|
26
21
|
|
|
27
22
|
targets = [
|
|
28
23
|
(environments_table, "snapshots"),
|
|
@@ -30,7 +25,6 @@ def migrate(state_sync, **kwargs): # type: ignore
|
|
|
30
25
|
(environments_table, "previous_finalized_snapshots"),
|
|
31
26
|
(environments_table, "requirements"),
|
|
32
27
|
(snapshots_table, "snapshot"),
|
|
33
|
-
(plan_dags_table, "dag_spec"),
|
|
34
28
|
]
|
|
35
29
|
|
|
36
30
|
for table_name, column_name in targets:
|
|
@@ -47,3 +41,7 @@ def migrate(state_sync, **kwargs): # type: ignore
|
|
|
47
41
|
)
|
|
48
42
|
|
|
49
43
|
engine_adapter.execute(alter_table_exp)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
47
|
+
pass
|
|
@@ -7,11 +7,13 @@ from sqlglot import exp, parse_one
|
|
|
7
7
|
from sqlmesh.utils.migration import index_text_type, blob_text_type
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
15
|
import pandas as pd
|
|
12
16
|
|
|
13
|
-
engine_adapter = state_sync.engine_adapter
|
|
14
|
-
schema = state_sync.schema
|
|
15
17
|
snapshots_table = "_snapshots"
|
|
16
18
|
index_type = index_text_type(engine_adapter.dialect)
|
|
17
19
|
if schema:
|
|
@@ -7,11 +7,13 @@ from sqlglot import exp
|
|
|
7
7
|
from sqlmesh.utils.migration import index_text_type, blob_text_type
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
15
|
import pandas as pd
|
|
12
16
|
|
|
13
|
-
engine_adapter = state_sync.engine_adapter
|
|
14
|
-
schema = state_sync.schema
|
|
15
17
|
snapshots_table = "_snapshots"
|
|
16
18
|
index_type = index_text_type(engine_adapter.dialect)
|
|
17
19
|
if schema:
|
|
@@ -5,9 +5,7 @@ from sqlglot import exp
|
|
|
5
5
|
from sqlmesh.utils.migration import index_text_type
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def
|
|
9
|
-
engine_adapter = state_sync.engine_adapter
|
|
10
|
-
schema = state_sync.schema
|
|
8
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
9
|
auto_restatements_table = "_auto_restatements"
|
|
12
10
|
intervals_table = "_intervals"
|
|
13
11
|
|
|
@@ -39,6 +37,13 @@ def migrate(state_sync, **kwargs): # type: ignore
|
|
|
39
37
|
)
|
|
40
38
|
engine_adapter.execute(alter_table_exp)
|
|
41
39
|
|
|
40
|
+
|
|
41
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
42
|
+
intervals_table = "_intervals"
|
|
43
|
+
|
|
44
|
+
if schema:
|
|
45
|
+
intervals_table = f"{schema}.{intervals_table}"
|
|
46
|
+
|
|
42
47
|
engine_adapter.update_table(
|
|
43
48
|
intervals_table,
|
|
44
49
|
{"is_pending_restatement": False},
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Add full precision for tsql to support nanoseconds."""
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def
|
|
4
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
9
|
pass
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Include the unrendered query in the metadata hash."""
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def
|
|
4
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
9
|
pass
|
|
@@ -7,11 +7,13 @@ from sqlglot import exp
|
|
|
7
7
|
from sqlmesh.utils.migration import index_text_type, blob_text_type
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
15
|
import pandas as pd
|
|
12
16
|
|
|
13
|
-
engine_adapter = state_sync.engine_adapter
|
|
14
|
-
schema = state_sync.schema
|
|
15
17
|
snapshots_table = "_snapshots"
|
|
16
18
|
environments_table = "_environments"
|
|
17
19
|
if schema:
|
|
@@ -8,14 +8,10 @@ from sqlglot import exp
|
|
|
8
8
|
from sqlmesh.utils.migration import index_text_type, blob_text_type
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def
|
|
12
|
-
engine_adapter = state_sync.engine_adapter
|
|
13
|
-
schema = state_sync.schema
|
|
11
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
14
12
|
intervals_table = "_intervals"
|
|
15
|
-
snapshots_table = "_snapshots"
|
|
16
13
|
if schema:
|
|
17
14
|
intervals_table = f"{schema}.{intervals_table}"
|
|
18
|
-
snapshots_table = f"{schema}.{snapshots_table}"
|
|
19
15
|
|
|
20
16
|
index_type = index_text_type(engine_adapter.dialect)
|
|
21
17
|
alter_table_exp = exp.Alter(
|
|
@@ -30,6 +26,14 @@ def migrate(state_sync, **kwargs): # type: ignore
|
|
|
30
26
|
)
|
|
31
27
|
engine_adapter.execute(alter_table_exp)
|
|
32
28
|
|
|
29
|
+
|
|
30
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
31
|
+
intervals_table = "_intervals"
|
|
32
|
+
snapshots_table = "_snapshots"
|
|
33
|
+
if schema:
|
|
34
|
+
intervals_table = f"{schema}.{intervals_table}"
|
|
35
|
+
snapshots_table = f"{schema}.{snapshots_table}"
|
|
36
|
+
|
|
33
37
|
used_dev_versions: t.Set[t.Tuple[str, str]] = set()
|
|
34
38
|
used_versions: t.Set[t.Tuple[str, str]] = set()
|
|
35
39
|
used_snapshot_ids: t.Set[t.Tuple[str, str]] = set()
|
|
@@ -5,9 +5,7 @@ from sqlglot import exp
|
|
|
5
5
|
from sqlmesh.utils.migration import blob_text_type, index_text_type
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def
|
|
9
|
-
engine_adapter = state_sync.engine_adapter
|
|
10
|
-
schema = state_sync.schema
|
|
8
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
11
9
|
environment_statements_table = "_environment_statements"
|
|
12
10
|
|
|
13
11
|
if schema:
|
|
@@ -25,3 +23,7 @@ def migrate(state_sync, **kwargs): # type: ignore
|
|
|
25
23
|
},
|
|
26
24
|
primary_key=("environment_name",),
|
|
27
25
|
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
29
|
+
pass
|
|
@@ -6,11 +6,13 @@ from sqlglot import exp
|
|
|
6
6
|
from sqlmesh.utils.migration import index_text_type, blob_text_type
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def
|
|
9
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
10
14
|
import pandas as pd
|
|
11
15
|
|
|
12
|
-
engine_adapter = state_sync.engine_adapter
|
|
13
|
-
schema = state_sync.schema
|
|
14
16
|
snapshots_table = "_snapshots"
|
|
15
17
|
if schema:
|
|
16
18
|
snapshots_table = f"{schema}.{snapshots_table}"
|
|
@@ -2,5 +2,9 @@
|
|
|
2
2
|
(default: True to keep the original behaviour)"""
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
def
|
|
5
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
6
|
+
pass
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
6
10
|
pass
|
|
@@ -8,11 +8,13 @@ from sqlmesh.utils.migration import index_text_type
|
|
|
8
8
|
from sqlmesh.utils.migration import blob_text_type
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def
|
|
11
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
12
16
|
import pandas as pd
|
|
13
17
|
|
|
14
|
-
engine_adapter = state_sync.engine_adapter
|
|
15
|
-
schema = state_sync.schema
|
|
16
18
|
snapshots_table = "_snapshots"
|
|
17
19
|
index_type = index_text_type(engine_adapter.dialect)
|
|
18
20
|
if schema:
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Add 'cron_tz' property to node definition."""
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def
|
|
4
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
9
|
pass
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Use the model's dialect when calculating the hash for the column types."""
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def
|
|
4
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
9
|
pass
|
|
@@ -24,9 +24,11 @@ import sqlmesh.core.dialect as d
|
|
|
24
24
|
from sqlmesh.core.console import get_console
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
def
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
30
32
|
snapshots_table = "_snapshots"
|
|
31
33
|
if schema:
|
|
32
34
|
snapshots_table = f"{schema}.{snapshots_table}"
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
from sqlglot import exp
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def
|
|
7
|
-
engine_adapter = state_sync.engine_adapter
|
|
6
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
8
7
|
environments_table = "_environments"
|
|
9
|
-
if
|
|
10
|
-
environments_table = f"{
|
|
8
|
+
if schema:
|
|
9
|
+
environments_table = f"{schema}.{environments_table}"
|
|
11
10
|
|
|
12
11
|
alter_table_exp = exp.Alter(
|
|
13
12
|
this=exp.to_table(environments_table),
|
|
@@ -21,7 +20,13 @@ def migrate(state_sync, **kwargs): # type: ignore
|
|
|
21
20
|
)
|
|
22
21
|
engine_adapter.execute(alter_table_exp)
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
|
|
24
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
25
|
+
environments_table = "_environments"
|
|
26
|
+
if schema:
|
|
27
|
+
environments_table = f"{schema}.{environments_table}"
|
|
28
|
+
|
|
29
|
+
engine_adapter.update_table(
|
|
25
30
|
environments_table,
|
|
26
31
|
{"gateway_managed": False},
|
|
27
32
|
where=exp.true(),
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Add batch_size to SCD Type 2 models and add updated_at_name to by time which changes their data hash."""
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def
|
|
4
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
9
|
pass
|
|
@@ -8,11 +8,13 @@ from sqlmesh.utils.migration import index_text_type
|
|
|
8
8
|
from sqlmesh.utils.migration import blob_text_type
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def
|
|
11
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
12
16
|
import pandas as pd
|
|
13
17
|
|
|
14
|
-
engine_adapter = state_sync.engine_adapter
|
|
15
|
-
schema = state_sync.schema
|
|
16
18
|
snapshots_table = "_snapshots"
|
|
17
19
|
index_type = index_text_type(engine_adapter.dialect)
|
|
18
20
|
if schema:
|
|
@@ -34,9 +34,11 @@ from sqlglot import exp
|
|
|
34
34
|
from sqlmesh.core.console import get_console
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
def
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
40
42
|
snapshots_table = "_snapshots"
|
|
41
43
|
if schema:
|
|
42
44
|
snapshots_table = f"{schema}.{snapshots_table}"
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Use sql(...) instead of gen when computing the data hash of the time data type."""
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def
|
|
4
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
5
9
|
pass
|
|
@@ -5,5 +5,9 @@ prevent un-normalized identifiers being quoted at the EngineAdapter level
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def
|
|
8
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
9
|
+
pass
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
9
13
|
pass
|
|
@@ -36,11 +36,13 @@ def _dict_sort(obj: t.Any) -> str:
|
|
|
36
36
|
return repr(obj)
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
def
|
|
39
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
40
44
|
import pandas as pd
|
|
41
45
|
|
|
42
|
-
engine_adapter = state_sync.engine_adapter
|
|
43
|
-
schema = state_sync.schema
|
|
44
46
|
snapshots_table = "_snapshots"
|
|
45
47
|
if schema:
|
|
46
48
|
snapshots_table = f"{schema}.{snapshots_table}"
|
|
@@ -10,9 +10,11 @@ logger = logging.getLogger(__name__)
|
|
|
10
10
|
KEYS_TO_MAKE_DETERMINISTIC = ["__sqlmesh__vars__", "__sqlmesh__blueprint__vars__"]
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
16
18
|
snapshots_table = "_snapshots"
|
|
17
19
|
versions_table = "_versions"
|
|
18
20
|
if schema:
|
|
@@ -35,11 +35,13 @@ class SqlValue:
|
|
|
35
35
|
sql: str
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def
|
|
38
|
+
def migrate_schemas(engine_adapter, schema, **kwargs): # type: ignore
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def migrate_rows(engine_adapter, schema, **kwargs): # type: ignore
|
|
39
43
|
import pandas as pd
|
|
40
44
|
|
|
41
|
-
engine_adapter = state_sync.engine_adapter
|
|
42
|
-
schema = state_sync.schema
|
|
43
45
|
snapshots_table = "_snapshots"
|
|
44
46
|
if schema:
|
|
45
47
|
snapshots_table = f"{schema}.{snapshots_table}"
|